model

package
v0.0.0-...-a9abf63 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Overview

Adding Models

Each model is kept in the model package of the REST v2 API in its own file. To create a new model, define a struct containing all of the fields that it will return and implement its two main interface methods BuildFromService and ToService. Be sure to include struct tags to the define the names the fields will have when serialized to JSON.

Guidelines for Creating Models

Include as much data as a user is likely to want when inspecting this resource. This is likely to be more information than seems directly needed, but there is little penalty to its inclusion.

Return an error when type casting fails.

Model Methods

The Model type is an interface with two methods.

BuildFromService(in interface{}) error

BuildFromService fetches all needed data from the passed in object and sets them on the model. BuildFromService may sometimes be called multiple times with different types that all contain data to build up the model object. In this case, a type switch is likely necessary to determine what has been passed in.

ToService()(interface{}, error)

ToService creates an as-complete-as-possible version of the service layer's version of this model. For example, if this is is a REST v2 Task model, the ToService method creates a service layer Task and sets all of the fields it is able to and returns it.

Index

Constants

View Source
const (
	TaskLogLinkFormat  = "%s/task_log_raw/%s/%d?type=%s"
	EventLogLinkFormat = "%s/event_log/task/%s"
)
View Source
const (
	// This string defines ISO-8601 UTC with 3 fractional seconds behind a dot
	// specified by the API spec document.
	APITimeFormat = "\"2006-01-02T15:04:05.000Z\""
)

Variables

This section is empty.

Functions

func Codegen

func Codegen(schema string, config ModelMapping) ([]byte, []byte, error)

Codegen takes a GraphQL schema as well as a mapping file of GQL structs to DB structs, then returns a generated REST model with conversion code, as well as utility code to convert between pointers

func FromStringPtr

func FromStringPtr(in *string) string

func FromStringPtrSlice

func FromStringPtrSlice(in []*string) []string

func FromTimePtr

func FromTimePtr(t *time.Time) (time.Time, error)

func MarshalAPIDuration

func MarshalAPIDuration(b APIDuration) graphql.Marshaler

func ParseTime

func ParseTime(tval string) (time.Time, error)

func ToStringPtr

func ToStringPtr(in string) *string

func ToStringPtrSlice

func ToStringPtrSlice(in []string) []*string

func ToTimePtr

func ToTimePtr(t time.Time) *time.Time

func UpdateUserSettings

func UpdateUserSettings(ctx context.Context, usr *user.DBUser, userSettings APIUserSettings) (*user.UserSettings, error)

UpdateUserSettings Returns an updated version of the user settings struct

Types

type APIAWSConfig

type APIAWSConfig struct {
	EC2Keys              []APIEC2Key       `json:"ec2_keys"`
	Subnets              []APISubnet       `json:"subnets"`
	S3                   *APIS3Credentials `json:"s3_credentials"`
	TaskSync             *APIS3Credentials `json:"task_sync"`
	TaskSyncRead         *APIS3Credentials `json:"task_sync_read"`
	S3BaseURL            *string           `json:"s3_base_url"`
	DefaultSecurityGroup *string           `json:"default_security_group"`
	AllowedInstanceTypes []*string         `json:"allowed_instance_types"`
	MaxVolumeSizePerUser *int              `json:"max_volume_size"`
}

func (*APIAWSConfig) BuildFromService

func (a *APIAWSConfig) BuildFromService(h interface{}) error

func (*APIAWSConfig) ToService

func (a *APIAWSConfig) ToService() (interface{}, error)

type APIAdminEvent

type APIAdminEvent struct {
	Timestamp *time.Time `json:"ts"`
	User      string     `json:"user"`
	Section   string     `json:"section"`
	Before    Model      `json:"before"`
	After     Model      `json:"after"`
	Guid      string     `json:"guid"`
}

func (*APIAdminEvent) BuildFromService

func (e *APIAdminEvent) BuildFromService(h interface{}) error

func (*APIAdminEvent) ToService

func (e *APIAdminEvent) ToService() (interface{}, error)

type APIAdminSettings

type APIAdminSettings struct {
	Alerts             *APIAlertsConfig                  `json:"alerts,omitempty"`
	Amboy              *APIAmboyConfig                   `json:"amboy,omitempty"`
	Api                *APIapiConfig                     `json:"api,omitempty"`
	ApiUrl             *string                           `json:"api_url,omitempty"`
	AuthConfig         *APIAuthConfig                    `json:"auth,omitempty"`
	Banner             *string                           `json:"banner,omitempty"`
	BannerTheme        *string                           `json:"banner_theme,omitempty"`
	Backup             *APIBackupConfig                  `json:"backup,omitempty"`
	ClientBinariesDir  *string                           `json:"client_binaries_dir,omitempty"`
	CommitQueue        *APICommitQueueConfig             `json:"commit_queue,omitempty"`
	ConfigDir          *string                           `json:"configdir,omitempty"`
	ContainerPools     *APIContainerPoolsConfig          `json:"container_pools,omitempty"`
	Credentials        map[string]string                 `json:"credentials,omitempty"`
	DomainName         *string                           `json:"domain_name,omitempty"`
	Expansions         map[string]string                 `json:"expansions,omitempty"`
	Bugsnag            *string                           `json:"bugsnag,omitempty"`
	GithubPRCreatorOrg *string                           `json:"github_pr_creator_org,omitempty"`
	GithubOrgs         []string                          `json:"github_orgs,omitempty"`
	HostInit           *APIHostInitConfig                `json:"hostinit,omitempty"`
	HostJasper         *APIHostJasperConfig              `json:"host_jasper,omitempty"`
	Jira               *APIJiraConfig                    `json:"jira,omitempty"`
	JIRANotifications  *APIJIRANotificationsConfig       `json:"jira_notifications,omitempty"`
	Keys               map[string]string                 `json:"keys,omitempty"`
	LDAPRoleMap        *APILDAPRoleMap                   `json:"ldap_role_map,omitempty"`
	LoggerConfig       *APILoggerConfig                  `json:"logger_config,omitempty"`
	LogPath            *string                           `json:"log_path,omitempty"`
	NewRelic           *APINewRelicConfig                `json:"newrelic,omitempty"`
	Notify             *APINotifyConfig                  `json:"notify,omitempty"`
	Plugins            map[string]map[string]interface{} `json:"plugins,omitempty"`
	PprofPort          *string                           `json:"pprof_port,omitempty"`
	Providers          *APICloudProviders                `json:"providers,omitempty"`
	RepoTracker        *APIRepoTrackerConfig             `json:"repotracker,omitempty"`
	Scheduler          *APISchedulerConfig               `json:"scheduler,omitempty"`
	ServiceFlags       *APIServiceFlags                  `json:"service_flags,omitempty"`
	Slack              *APISlackConfig                   `json:"slack,omitempty"`
	SSHKeyDirectory    *string                           `json:"ssh_key_directory,omitempty"`
	SSHKeyPairs        []APISSHKeyPair                   `json:"ssh_key_pairs,omitempty"`
	Splunk             *APISplunkConnectionInfo          `json:"splunk,omitempty"`
	Triggers           *APITriggerConfig                 `json:"triggers,omitempty"`
	Ui                 *APIUIConfig                      `json:"ui,omitempty"`
	Spawnhost          *APISpawnHostConfig               `json:"spawnhost,omitempty"`
}

APIAdminSettings is the structure of a response to the admin route

func NewConfigModel

func NewConfigModel() *APIAdminSettings

func (*APIAdminSettings) BuildFromService

func (as *APIAdminSettings) BuildFromService(h interface{}) error

BuildFromService builds a model from the service layer

func (*APIAdminSettings) ToService

func (as *APIAdminSettings) ToService() (interface{}, error)

ToService returns a service model from an API model

type APIAlertsConfig

type APIAlertsConfig struct {
	SMTP APISMTPConfig `json:"smtp"`
}

func (*APIAlertsConfig) BuildFromService

func (a *APIAlertsConfig) BuildFromService(h interface{}) error

func (*APIAlertsConfig) ToService

func (a *APIAlertsConfig) ToService() (interface{}, error)

type APIAmboyConfig

type APIAmboyConfig struct {
	Name                                  *string `json:"name"`
	SingleName                            *string `json:"single_name"`
	DB                                    *string `json:"database"`
	PoolSizeLocal                         int     `json:"pool_size_local"`
	PoolSizeRemote                        int     `json:"pool_size_remote"`
	LocalStorage                          int     `json:"local_storage_size"`
	GroupDefaultWorkers                   int     `json:"group_default_workers"`
	GroupBackgroundCreateFrequencyMinutes int     `json:"group_background_create_frequency"`
	GroupPruneFrequencyMinutes            int     `json:"group_prune_frequency"`
	GroupTTLMinutes                       int     `json:"group_ttl"`
	RequireRemotePriority                 bool    `json:"require_remote_priority"`
	LockTimeoutMinutes                    int     `json:"lock_timeout_minutes"`
}

func (*APIAmboyConfig) BuildFromService

func (a *APIAmboyConfig) BuildFromService(h interface{}) error

func (*APIAmboyConfig) ToService

func (a *APIAmboyConfig) ToService() (interface{}, error)

type APIAuthConfig

type APIAuthConfig struct {
	LDAP                    *APILDAPConfig        `json:"ldap"`
	Okta                    *APIOktaConfig        `json:"okta"`
	Naive                   *APINaiveAuthConfig   `json:"naive"`
	OnlyAPI                 *APIOnlyAPIAuthConfig `json:"only_api"`
	Github                  *APIGithubAuthConfig  `json:"github"`
	Multi                   *APIMultiAuthConfig   `json:"multi"`
	PreferredType           *string               `json:"preferred_type"`
	BackgroundReauthMinutes int                   `json:"background_reauth_minutes"`
}

func (*APIAuthConfig) BuildFromService

func (a *APIAuthConfig) BuildFromService(h interface{}) error

func (*APIAuthConfig) ToService

func (a *APIAuthConfig) ToService() (interface{}, error)

type APIAuthUser

type APIAuthUser struct {
	Username    *string `json:"username"`
	DisplayName *string `json:"display_name"`
	Password    *string `json:"password"`
	Email       *string `json:"email"`
}

func (*APIAuthUser) BuildFromService

func (a *APIAuthUser) BuildFromService(h interface{}) error

func (*APIAuthUser) ToService

func (a *APIAuthUser) ToService() (interface{}, error)

type APIBackupConfig

type APIBackupConfig struct {
	BucketName *string `bson:"bucket_name" json:"bucket_name" yaml:"bucket_name"`
	Key        *string `bson:"key" json:"key" yaml:"key"`
	Secret     *string `bson:"secret" json:"secret" yaml:"secret"`
	Prefix     *string `bson:"prefix" json:"prefix" yaml:"prefix"`
	Compress   bool    `bson:"compress" json:"compress" yaml:"compress"`
}

func (*APIBackupConfig) BuildFromService

func (a *APIBackupConfig) BuildFromService(c interface{}) error

func (*APIBackupConfig) ToService

func (a *APIBackupConfig) ToService() (interface{}, error)

type APIBanner

type APIBanner struct {
	Text  *string `json:"banner"`
	Theme *string `json:"theme"`
}

APIBanner is a public structure representing the banner part of the admin settings

func (*APIBanner) BuildFromService

func (ab *APIBanner) BuildFromService(h interface{}) error

BuildFromService builds a model from the service layer

func (*APIBanner) ToService

func (ab *APIBanner) ToService() (interface{}, error)

ToService is not yet implemented

type APIBootstrapSettings

type APIBootstrapSettings struct {
	Method                *string           `json:"method"`
	Communication         *string           `json:"communication"`
	ClientDir             *string           `json:"client_dir"`
	JasperBinaryDir       *string           `json:"jasper_binary_dir"`
	JasperCredentialsPath *string           `json:"jasper_credentials_path"`
	ServiceUser           *string           `json:"service_user"`
	ShellPath             *string           `json:"shell_path"`
	RootDir               *string           `json:"root_dir"`
	Env                   []APIEnvVar       `json:"env"`
	ResourceLimits        APIResourceLimits `json:"resource_limits"`
}

func (*APIBootstrapSettings) BuildFromService

func (s *APIBootstrapSettings) BuildFromService(h interface{}) error

BuildFromService converts from service level distro.BootstrapSettings to an APIBootstrapSettings.

func (*APIBootstrapSettings) ToService

func (s *APIBootstrapSettings) ToService() (interface{}, error)

ToService returns a service layer distro.BootstrapSettings using the data from APIBootstrapSettings.

type APIBuild

type APIBuild struct {
	Id                  *string        `json:"_id"`
	ProjectId           *string        `json:"project_id"`
	CreateTime          *time.Time     `json:"create_time"`
	StartTime           *time.Time     `json:"start_time"`
	FinishTime          *time.Time     `json:"finish_time"`
	Version             *string        `json:"version"`
	Revision            *string        `json:"git_hash"`
	BuildVariant        *string        `json:"build_variant"`
	Status              *string        `json:"status"`
	Activated           bool           `json:"activated"`
	ActivatedBy         *string        `json:"activated_by"`
	ActivatedTime       *time.Time     `json:"activated_time"`
	RevisionOrderNumber int            `json:"order"`
	TaskCache           []APITaskCache `json:"task_cache"`
	// Tasks is the build's task cache with just the names
	Tasks             []string             `json:"tasks"`
	TimeTaken         APIDuration          `json:"time_taken_ms"`
	DisplayName       *string              `json:"display_name"`
	PredictedMakespan APIDuration          `json:"predicted_makespan_ms"`
	ActualMakespan    APIDuration          `json:"actual_makespan_ms"`
	Origin            *string              `json:"origin"`
	StatusCounts      task.TaskStatusCount `json:"status_counts"`
}

APIBuild is the model to be returned by the API whenever builds are fetched.

func (*APIBuild) BuildFromService

func (apiBuild *APIBuild) BuildFromService(h interface{}) error

BuildFromService converts from service level structs to an APIBuild. APIBuild.ProjectId is set in the route builder's Execute method.

func (*APIBuild) ToService

func (apiBuild *APIBuild) ToService() (interface{}, error)

ToService returns a service layer build using the data from the APIBuild.

type APICLIUpdate

type APICLIUpdate struct {
	ClientConfig APIClientConfig `json:"client_config"`
	IgnoreUpdate bool            `json:"ignore_update"`
}

func (*APICLIUpdate) BuildFromService

func (a *APICLIUpdate) BuildFromService(h interface{}) error

func (*APICLIUpdate) ToService

func (a *APICLIUpdate) ToService() (interface{}, error)

type APIClientBinary

type APIClientBinary struct {
	Arch        *string `json:"arch"`
	OS          *string `json:"os"`
	URL         *string `json:"url"`
	DisplayName *string `json:"display_name"`
}

func (*APIClientBinary) BuildFromService

func (a *APIClientBinary) BuildFromService(h interface{}) error

func (*APIClientBinary) ToService

func (a *APIClientBinary) ToService() (interface{}, error)

type APIClientConfig

type APIClientConfig struct {
	ClientBinaries []APIClientBinary `json:"client_binaries,omitempty"`
	LatestRevision *string           `json:"latest_revision"`
}

func (*APIClientConfig) BuildFromService

func (a *APIClientConfig) BuildFromService(h interface{}) error

func (*APIClientConfig) ToService

func (a *APIClientConfig) ToService() (interface{}, error)

type APICloudProviders

type APICloudProviders struct {
	AWS       *APIAWSConfig       `json:"aws"`
	Docker    *APIDockerConfig    `json:"docker"`
	GCE       *APIGCEConfig       `json:"gce"`
	OpenStack *APIOpenStackConfig `json:"openstack"`
	VSphere   *APIVSphereConfig   `json:"vsphere"`
}

func (*APICloudProviders) BuildFromService

func (a *APICloudProviders) BuildFromService(h interface{}) error

func (*APICloudProviders) ToService

func (a *APICloudProviders) ToService() (interface{}, error)

type APICommitQueue

type APICommitQueue struct {
	ProjectID *string              `json:"queue_id"`
	Queue     []APICommitQueueItem `json:"queue"`
}

func (*APICommitQueue) BuildFromService

func (cq *APICommitQueue) BuildFromService(h interface{}) error

func (*APICommitQueue) ToService

func (cq *APICommitQueue) ToService() (interface{}, error)

type APICommitQueueConfig

type APICommitQueueConfig struct {
	MergeTaskDistro *string `json:"merge_task_distro"`
	CommitterName   *string `json:"committer_name"`
	CommitterEmail  *string `json:"committer_email"`
}

func (*APICommitQueueConfig) BuildFromService

func (a *APICommitQueueConfig) BuildFromService(h interface{}) error

func (*APICommitQueueConfig) ToService

func (a *APICommitQueueConfig) ToService() (interface{}, error)

type APICommitQueueItem

type APICommitQueueItem struct {
	Issue       *string     `json:"issue"`
	Version     *string     `json:"version"`
	EnqueueTime *time.Time  `json:"enqueueTime"`
	Modules     []APIModule `json:"modules"`
	Patch       *APIPatch   `json:"patch"`
}

func (*APICommitQueueItem) BuildFromService

func (item *APICommitQueueItem) BuildFromService(h interface{}) error

func (*APICommitQueueItem) ToService

func (item *APICommitQueueItem) ToService() (interface{}, error)

type APICommitQueueItemAuthor

type APICommitQueueItemAuthor struct {
	Author *string `json:"author"`
}

type APICommitQueueParams

type APICommitQueueParams struct {
	Enabled     bool    `json:"enabled"`
	MergeMethod *string `json:"merge_method"`
	PatchType   *string `json:"patch_type"`
}

func (*APICommitQueueParams) BuildFromService

func (cqParams *APICommitQueueParams) BuildFromService(h interface{}) error

func (*APICommitQueueParams) ToService

func (cqParams *APICommitQueueParams) ToService() (interface{}, error)

type APICommitQueuePosition

type APICommitQueuePosition struct {
	Position int `json:"position"`
}

type APIContainerPool

type APIContainerPool struct {
	Distro        *string `json:"distro"`
	Id            *string `json:"id"`
	MaxContainers int     `json:"max_containers"`
	Port          uint16  `json:"port"`
}

func (*APIContainerPool) BuildFromService

func (a *APIContainerPool) BuildFromService(h interface{}) error

func (*APIContainerPool) ToService

func (a *APIContainerPool) ToService() (interface{}, error)

type APIContainerPoolsConfig

type APIContainerPoolsConfig struct {
	Pools []APIContainerPool `json:"pools"`
}

func (*APIContainerPoolsConfig) BuildFromService

func (a *APIContainerPoolsConfig) BuildFromService(h interface{}) error

func (*APIContainerPoolsConfig) ToService

func (a *APIContainerPoolsConfig) ToService() (interface{}, error)

type APIDependency

type APIDependency struct {
	TaskId string `bson:"_id" json:"id"`
	Status string `bson:"status" json:"status"`
}

func (*APIDependency) BuildFromService

func (ad *APIDependency) BuildFromService(dep task.Dependency)

func (*APIDependency) ToService

func (ad *APIDependency) ToService() (interface{}, error)

type APIDispatcherSettings

type APIDispatcherSettings struct {
	Version *string `json:"version"`
}

func (*APIDispatcherSettings) BuildFromService

func (s *APIDispatcherSettings) BuildFromService(h interface{}) error

BuildFromService converts from service level distro.DispatcherSettings to an APIDispatcherSettings

func (*APIDispatcherSettings) ToService

func (s *APIDispatcherSettings) ToService() (interface{}, error)

ToService returns a service layer distro.DispatcherSettings using the data from APIDispatcherSettings

type APIDistro

type APIDistro struct {
	Name                  *string                  `json:"name"`
	Aliases               []string                 `json:"aliases"`
	UserSpawnAllowed      bool                     `json:"user_spawn_allowed"`
	Provider              *string                  `json:"provider"`
	ProviderSettingsList  []*birch.Document        `json:"provider_settings"`
	Arch                  *string                  `json:"arch"`
	WorkDir               *string                  `json:"work_dir"`
	SetupAsSudo           bool                     `json:"setup_as_sudo"`
	Setup                 *string                  `json:"setup"`
	User                  *string                  `json:"user"`
	BootstrapSettings     APIBootstrapSettings     `json:"bootstrap_settings"`
	CloneMethod           *string                  `json:"clone_method"`
	SSHKey                *string                  `json:"ssh_key"`
	SSHOptions            []string                 `json:"ssh_options"`
	AuthorizedKeysFile    *string                  `json:"authorized_keys_file"`
	Expansions            []APIExpansion           `json:"expansions"`
	Disabled              bool                     `json:"disabled"`
	ContainerPool         *string                  `json:"container_pool"`
	FinderSettings        APIFinderSettings        `json:"finder_settings"`
	PlannerSettings       APIPlannerSettings       `json:"planner_settings"`
	DispatcherSettings    APIDispatcherSettings    `json:"dispatcher_settings"`
	HostAllocatorSettings APIHostAllocatorSettings `json:"host_allocator_settings"`
	DisableShallowClone   bool                     `json:"disable_shallow_clone"`
	UseLegacyAgent        bool                     `json:"use_legacy_agent"`
	HomeVolumeSettings    APIHomeVolumeSettings    `json:"home_volume_settings"`
	IcecreamSettings      APIIcecreamSettings      `json:"icecream_settings"`
	IsVirtualWorkstation  bool                     `json:"is_virtual_workstation"`
	IsCluster             bool                     `json:"is_cluster"`
	Note                  *string                  `json:"note"`
	ValidProjects         []*string                `json:"valid_projects"`
}

func (*APIDistro) BuildFromService

func (apiDistro *APIDistro) BuildFromService(h interface{}) error

BuildFromService converts from service level distro.Distro to an APIDistro

func (*APIDistro) ToService

func (apiDistro *APIDistro) ToService() (interface{}, error)

ToService returns a service layer distro using the data from APIDistro

type APIDistroCost

type APIDistroCost struct {
	DistroId      *string     `json:"distro_id"`
	SumTimeTaken  APIDuration `json:"sum_time_taken"`
	Provider      *string     `json:"provider"`
	InstanceType  *string     `json:"instance_type,omitempty"`
	EstimatedCost float64     `json:"estimated_cost"`
	NumTasks      int         `json:"num_tasks"`
}

APIDistroCost is the model to be returned by the API whenever cost data is fetched by distro id.

func (*APIDistroCost) BuildFromService

func (apiDistroCost *APIDistroCost) BuildFromService(h interface{}) error

BuildFromService converts from a service level task by loading the data into the appropriate fields of the APIDistroCost.

func (*APIDistroCost) ToService

func (apiDistroCost *APIDistroCost) ToService() (interface{}, error)

ToService returns a service layer distro cost using the data from APIDistroCost.

type APIDistroScriptOptions

type APIDistroScriptOptions struct {
	Script            string `json:"script"`
	IncludeTaskHosts  bool   `json:"include_task_hosts"`
	IncludeSpawnHosts bool   `json:"include_spawn_hosts"`
	Sudo              bool   `json:"sudo"`
	SudoUser          string `json:"sudo_user"`
}

APIDistroScriptOptions provides a model to execute scripts on hosts in a distro.

type APIDockerConfig

type APIDockerConfig struct {
	APIVersion    *string `json:"api_version"`
	DefaultDistro *string `json:"default_distro"`
}

func (*APIDockerConfig) BuildFromService

func (a *APIDockerConfig) BuildFromService(h interface{}) error

func (*APIDockerConfig) ToService

func (a *APIDockerConfig) ToService() (interface{}, error)

type APIDuration

type APIDuration uint64

Represents duration in milliseconds

func NewAPIDuration

func NewAPIDuration(d time.Duration) APIDuration

func UnmarshalAPIDuration

func UnmarshalAPIDuration(v interface{}) (APIDuration, error)

func (APIDuration) ToDuration

func (i APIDuration) ToDuration() time.Duration

type APIEC2Key

type APIEC2Key struct {
	Name   *string `json:"name"`
	Region *string `json:"region"`
	Key    *string `json:"key"`
	Secret *string `json:"secret"`
}

func (*APIEC2Key) BuildFromService

func (a *APIEC2Key) BuildFromService(h interface{}) error

func (*APIEC2Key) ToService

func (a *APIEC2Key) ToService() (interface{}, error)

type APIEmail

type APIEmail struct {
	From              *string             `json:"from"`
	Recipients        []string            `json:"recipients"`
	Subject           *string             `json:"subject"`
	Body              *string             `json:"body"`
	PlainTextContents bool                `json:"is_plain_text"`
	Headers           map[string][]string `json:"headers"`
}

func (*APIEmail) BuildFromService

func (n *APIEmail) BuildFromService(h interface{}) error

BuildFromService converts from service level message.Email to an APIEmail.

func (*APIEmail) ToService

func (n *APIEmail) ToService() (interface{}, error)

ToService returns a service layer message.Email using the data from APIEmail.

type APIEntry

type APIEntry struct {
	TaskId          *string   `json:"task_id"`
	TaskDisplayName *string   `json:"task_name"`
	BuildId         *string   `json:"build"`
	Files           []APIFile `json:"files"`
	Execution       int       `json:"execution"`
}

func (*APIEntry) BuildFromService

func (e *APIEntry) BuildFromService(h interface{}) error

func (*APIEntry) ToService

func (e *APIEntry) ToService() (interface{}, error)

type APIEnvVar

type APIEnvVar struct {
	Key   *string `json:"key"`
	Value *string `json:"value"`
}

func (*APIEnvVar) BuildFromService

func (e *APIEnvVar) BuildFromService(h interface{}) error

BuildFromService converts a service level distro.EnvVar to an APIEnvVar

func (*APIEnvVar) ToService

func (e *APIEnvVar) ToService() (interface{}, error)

ToService returns a service layer distro.EnvVar using the data from an APIEnvVar

type APIEventLogEntry

type APIEventLogEntry struct {
	ID           *string        `bson:"_id" json:"-"`
	ResourceType *string        `bson:"r_type,omitempty" json:"resource_type,omitempty"`
	ProcessedAt  *time.Time     `bson:"processed_at" json:"processed_at"`
	Timestamp    *time.Time     `bson:"ts" json:"timestamp"`
	ResourceId   *string        `bson:"r_id" json:"resource_id"`
	EventType    *string        `bson:"e_type" json:"event_type"`
	Data         *TaskEventData `bson:"data" json:"data"`
}

func (*APIEventLogEntry) BuildFromService

func (el *APIEventLogEntry) BuildFromService(t interface{}) error

func (*APIEventLogEntry) ToService

func (el *APIEventLogEntry) ToService() (interface{}, error)

ToService is not implemented for APITestStats.

type APIEventStats

type APIEventStats struct {
	LastProcessedAt            *time.Time           `json:"last_processed_at"`
	NumUnprocessedEvents       int                  `json:"unprocessed_events"`
	PendingNotificationsByType apiNotificationStats `json:"pending_notifications_by_type"`
}

func (*APIEventStats) BuildFromService

func (n *APIEventStats) BuildFromService(h interface{}) error

func (*APIEventStats) ToService

func (n *APIEventStats) ToService() (interface{}, error)

type APIExpansion

type APIExpansion struct {
	Key   *string `json:"key"`
	Value *string `json:"value"`
}

APIExpansion is derived from a service layer distro.Expansion

func (*APIExpansion) BuildFromService

func (e *APIExpansion) BuildFromService(h interface{}) error

BuildFromService converts a service level distro.Expansion to an APIExpansion

func (*APIExpansion) ToService

func (e *APIExpansion) ToService() (interface{}, error)

ToService returns a service layer distro.Expansion using the data from an APIExpansion

type APIFeedbackSubmission

type APIFeedbackSubmission struct {
	Type        *string             `json:"type"`
	User        *string             `json:"user"`
	SubmittedAt *time.Time          `json:"submitted_at"`
	Questions   []APIQuestionAnswer `json:"questions"`
}

func (*APIFeedbackSubmission) BuildFromService

func (a *APIFeedbackSubmission) BuildFromService(h interface{}) error

func (*APIFeedbackSubmission) ToService

func (a *APIFeedbackSubmission) ToService() (interface{}, error)

type APIFile

type APIFile struct {
	Name           *string `json:"name"`
	Link           *string `json:"url"`
	Visibility     *string `json:"visibility"`
	IgnoreForFetch bool    `json:"ignore_for_fetch"`
}

func (*APIFile) BuildFromService

func (f *APIFile) BuildFromService(h interface{}) error

func (*APIFile) ToService

func (f *APIFile) ToService() (interface{}, error)

type APIFinderSettings

type APIFinderSettings struct {
	Version *string `json:"version"`
}

func (*APIFinderSettings) BuildFromService

func (s *APIFinderSettings) BuildFromService(h interface{}) error

BuildFromService converts from service level distro.FinderSettings to an APIFinderSettings

func (*APIFinderSettings) ToService

func (s *APIFinderSettings) ToService() (interface{}, error)

ToService returns a service layer distro.FinderSettings using the data from APIFinderSettings

type APIGCEConfig

type APIGCEConfig struct {
	ClientEmail  *string `json:"client_email"`
	PrivateKey   *string `json:"private_key"`
	PrivateKeyID *string `json:"private_key_id"`
	TokenURI     *string `json:"token_uri"`
}

func (*APIGCEConfig) BuildFromService

func (a *APIGCEConfig) BuildFromService(h interface{}) error

func (*APIGCEConfig) ToService

func (a *APIGCEConfig) ToService() (interface{}, error)

type APIGithubAuthConfig

type APIGithubAuthConfig struct {
	ClientId     *string   `json:"client_id"`
	ClientSecret *string   `json:"client_secret"`
	Users        []*string `json:"users"`
	Organization *string   `json:"organization"`
}

func (*APIGithubAuthConfig) BuildFromService

func (a *APIGithubAuthConfig) BuildFromService(h interface{}) error

func (*APIGithubAuthConfig) ToService

func (a *APIGithubAuthConfig) ToService() (interface{}, error)

type APIGithubHook

type APIGithubHook struct {
	HookID int     `json:"hook_id"`
	Owner  *string `json:"owner"`
	Repo   *string `json:"repo"`
}

func (*APIGithubHook) BuildFromService

func (a *APIGithubHook) BuildFromService(h interface{}) error

func (*APIGithubHook) ToService

func (*APIGithubHook) ToService() (interface{}, error)

ToService returns a service layer build using the data from the APIBuild.

type APIGithubMergeSubscriber

type APIGithubMergeSubscriber struct {
	PRs         []APIPRInfo `json:"prs" mapstructure:"prs"`
	Item        *string     `json:"item" mapstructure:"item"`
	MergeMethod *string     `json:"merge_method" mapstructure:"merge_method"`
}

func (*APIGithubMergeSubscriber) BuildFromService

func (s *APIGithubMergeSubscriber) BuildFromService(h interface{}) error

func (*APIGithubMergeSubscriber) ToService

func (s *APIGithubMergeSubscriber) ToService() (interface{}, error)

type APIGithubPRSubscriber

type APIGithubPRSubscriber struct {
	Owner    *string `json:"owner" mapstructure:"owner"`
	Repo     *string `json:"repo" mapstructure:"repo"`
	PRNumber int     `json:"pr_number" mapstructure:"pr_number"`
	Ref      *string `json:"ref" mapstructure:"ref"`
}

func (*APIGithubPRSubscriber) BuildFromService

func (s *APIGithubPRSubscriber) BuildFromService(h interface{}) error

func (*APIGithubPRSubscriber) ToService

func (s *APIGithubPRSubscriber) ToService() (interface{}, error)

type APIGithubUser

type APIGithubUser struct {
	UID         int     `json:"uid,omitempty"`
	LastKnownAs *string `json:"last_known_as,omitempty"`
}

func (*APIGithubUser) BuildFromService

func (g *APIGithubUser) BuildFromService(h interface{}) error

func (*APIGithubUser) ToService

func (g *APIGithubUser) ToService() (interface{}, error)

type APIHomeVolumeSettings

type APIHomeVolumeSettings struct {
	FormatCommand *string `json:"format_command"`
}

func (*APIHomeVolumeSettings) BuildFromService

func (s *APIHomeVolumeSettings) BuildFromService(h interface{}) error

func (*APIHomeVolumeSettings) ToService

func (s *APIHomeVolumeSettings) ToService() (interface{}, error)

type APIHost

type APIHost struct {
	Id               *string    `json:"host_id"`
	HostURL          *string    `json:"host_url"`
	Distro           DistroInfo `json:"distro"`
	Provisioned      bool       `json:"provisioned"`
	StartedBy        *string    `json:"started_by"`
	Provider         *string    `json:"host_type"`
	User             *string    `json:"user"`
	Status           *string    `json:"status"`
	RunningTask      taskInfo   `json:"running_task"`
	UserHost         bool       `json:"user_host"`
	NoExpiration     bool       `json:"no_expiration"`
	InstanceTags     []host.Tag `json:"instance_tags"`
	InstanceType     *string    `json:"instance_type"`
	AvailabilityZone *string    `json:"zone"`
	DisplayName      *string    `json:"display_name"`
	HomeVolumeID     *string    `json:"home_volume_id"`
}

APIHost is the model to be returned by the API whenever hosts are fetched.

func (*APIHost) BuildFromService

func (apiHost *APIHost) BuildFromService(h interface{}) error

BuildFromService converts from service level structs to an APIHost. It can be called multiple times with different data types, a service layer host and a service layer task, which are each loaded into the data structure.

func (*APIHost) ToService

func (apiHost *APIHost) ToService() (interface{}, error)

ToService returns a service layer host using the data from the APIHost.

type APIHostAllocatorSettings

type APIHostAllocatorSettings struct {
	Version                *string     `json:"version"`
	MinimumHosts           int         `json:"minimum_hosts"`
	MaximumHosts           int         `json:"maximum_hosts"`
	AcceptableHostIdleTime APIDuration `json:"acceptable_host_idle_time"`
}

func (*APIHostAllocatorSettings) BuildFromService

func (s *APIHostAllocatorSettings) BuildFromService(h interface{}) error

BuildFromService converts from service level distro.HostAllocatorSettings to an APIHostAllocatorSettings

func (*APIHostAllocatorSettings) ToService

func (s *APIHostAllocatorSettings) ToService() (interface{}, error)

ToService returns a service layer distro.HostAllocatorSettings using the data from APIHostAllocatorSettings

type APIHostInitConfig

type APIHostInitConfig struct {
	HostThrottle         int `json:"host_throttle"`
	ProvisioningThrottle int `json:"provisioning_throttle"`
	CloudStatusBatchSize int `json:"cloud_batch_size"`
}

func (*APIHostInitConfig) BuildFromService

func (a *APIHostInitConfig) BuildFromService(h interface{}) error

func (*APIHostInitConfig) ToService

func (a *APIHostInitConfig) ToService() (interface{}, error)

type APIHostJasperConfig

type APIHostJasperConfig struct {
	BinaryName       *string `json:"binary_name,omitempty"`
	DownloadFileName *string `json:"download_file_name,omitempty"`
	Port             int     `json:"port,omitempty"`
	URL              *string `json:"url,omitempty"`
	Version          *string `json:"version,omitempty"`
}

func (*APIHostJasperConfig) BuildFromService

func (c *APIHostJasperConfig) BuildFromService(h interface{}) error

func (*APIHostJasperConfig) ToService

func (c *APIHostJasperConfig) ToService() (interface{}, error)

type APIHostParams

type APIHostParams struct {
	CreatedBefore time.Time `json:"created_before"`
	CreatedAfter  time.Time `json:"created_after"`
	Distro        string    `json:"distro"`
	Status        string    `json:"status"`
	Region        string    `json:"region"`
	UserSpawned   bool      `json:"user_spawned"`
	Mine          bool      `json:"mine"`
}

type APIHostProcess

type APIHostProcess struct {
	HostID   string `json:"host_id"`
	ProcID   string `json:"proc_id"`
	Complete bool   `json:"complete"`
	Output   string `json:"output"`
}

type APIHostScript

type APIHostScript struct {
	Hosts  []string `json:"hosts"`
	Script string   `json:"script"`
}

type APIHostStatsByDistro

type APIHostStatsByDistro struct {
	Distros []apiHostStatsForDistro `json:"distros"`
}

APIHostStatsByDistro is a slice of host stats for a distro the 3 structs below are nested within it

func (*APIHostStatsByDistro) BuildFromService

func (s *APIHostStatsByDistro) BuildFromService(h interface{}) error

BuildFromService takes the slice of stats returned by GetHostStatsByDistro and embeds them so that the return value is a slice of distros

func (*APIHostStatsByDistro) ToService

func (s *APIHostStatsByDistro) ToService() (interface{}, error)

ToService is not implemented for APIHostStatsByDistro

type APIIcecreamSettings

type APIIcecreamSettings struct {
	SchedulerHost *string `json:"scheduler_host"`
	ConfigPath    *string `json:"config_path"`
}

func (*APIIcecreamSettings) BuildFromService

func (s *APIIcecreamSettings) BuildFromService(h interface{}) error

func (*APIIcecreamSettings) ToService

func (s *APIIcecreamSettings) ToService() (interface{}, error)

type APIJIRAIssueSubscriber

type APIJIRAIssueSubscriber struct {
	Project   *string `json:"project" mapstructure:"project"`
	IssueType *string `json:"issue_type" mapstructure:"issue_type"`
}

func (*APIJIRAIssueSubscriber) BuildFromService

func (s *APIJIRAIssueSubscriber) BuildFromService(h interface{}) error

func (*APIJIRAIssueSubscriber) ToService

func (s *APIJIRAIssueSubscriber) ToService() (interface{}, error)

type APIJIRANotificationsConfig

type APIJIRANotificationsConfig struct {
	CustomFields map[string]APIJIRANotificationsProject `json:"custom_fields,omitempty"`
}

func (*APIJIRANotificationsConfig) BuildFromService

func (j *APIJIRANotificationsConfig) BuildFromService(h interface{}) error

func (*APIJIRANotificationsConfig) ToService

func (j *APIJIRANotificationsConfig) ToService() (interface{}, error)

type APIJIRANotificationsProject

type APIJIRANotificationsProject struct {
	Fields     map[string]string `json:"fields,omitempty"`
	Components []string          `json:"components,omitempty"`
	Labels     []string          `json:"labels,omitempty"`
}

func (*APIJIRANotificationsProject) BuildFromService

func (j *APIJIRANotificationsProject) BuildFromService(h interface{}) error

func (*APIJIRANotificationsProject) ToService

func (j *APIJIRANotificationsProject) ToService() (interface{}, error)

type APIJiraBasicAuth

type APIJiraBasicAuth struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

func (*APIJiraBasicAuth) BuildFromService

func (a *APIJiraBasicAuth) BuildFromService(c evergreen.JiraBasicAuthConfig)

func (*APIJiraBasicAuth) ToService

type APIJiraComment

type APIJiraComment struct {
	IssueID *string `json:"issue_id"`
	Body    *string `json:"body"`
}

func (*APIJiraComment) BuildFromService

func (c *APIJiraComment) BuildFromService(h interface{}) error

BuildFromService converts from service level message.JIRAComment to APIJiraComment.

func (*APIJiraComment) ToService

func (c *APIJiraComment) ToService() (interface{}, error)

ToService returns a service layer message.JIRAComment using the data from APIJiraComment.

type APIJiraConfig

type APIJiraConfig struct {
	Host            *string           `json:"host"`
	DefaultProject  *string           `json:"default_project"`
	BasicAuthConfig *APIJiraBasicAuth `json:"basic_auth"`
	OAuth1Config    *APIJiraOAuth1    `json:"oauth1"`
}

func (*APIJiraConfig) BuildFromService

func (a *APIJiraConfig) BuildFromService(h interface{}) error

func (*APIJiraConfig) ToService

func (a *APIJiraConfig) ToService() (interface{}, error)

type APIJiraIssue

type APIJiraIssue struct {
	IssueKey    *string                `json:"issue_key"`
	Project     *string                `json:"project"`
	Summary     *string                `json:"summary"`
	Description *string                `json:"description"`
	Reporter    *string                `json:"reporter"`
	Assignee    *string                `json:"assignee"`
	Type        *string                `json:"type"`
	Components  []string               `json:"components"`
	Labels      []string               `json:"labels"`
	Fields      map[string]interface{} `json:"fields"`
}

func (*APIJiraIssue) BuildFromService

func (i *APIJiraIssue) BuildFromService(h interface{}) error

BuildFromService converts from service level message.JiraIssue to APIJiraIssue.

func (*APIJiraIssue) ToService

func (i *APIJiraIssue) ToService() (interface{}, error)

ToService returns a service layer message.JiraIssue using the data from APIJiraIssue.

type APIJiraOAuth1

type APIJiraOAuth1 struct {
	PrivateKey  *string `json:"private_key"`
	AccessToken *string `json:"access_token"`
	TokenSecret *string `json:"token_secret"`
	ConsumerKey *string `json:"consumer_key"`
}

func (*APIJiraOAuth1) BuildFromService

func (a *APIJiraOAuth1) BuildFromService(c evergreen.JiraOAuth1Config)

func (*APIJiraOAuth1) ToService

func (a *APIJiraOAuth1) ToService() evergreen.JiraOAuth1Config

type APILDAPConfig

type APILDAPConfig struct {
	URL                *string `json:"url"`
	Port               *string `json:"port"`
	UserPath           *string `json:"path"`
	ServicePath        *string `json:"service_path"`
	Group              *string `json:"group"`
	ServiceGroup       *string `json:"service_group"`
	ExpireAfterMinutes *string `json:"expire_after_minutes"`
	GroupOU            *string `json:"group_ou"`
}

func (*APILDAPConfig) BuildFromService

func (a *APILDAPConfig) BuildFromService(h interface{}) error

func (*APILDAPConfig) ToService

func (a *APILDAPConfig) ToService() (interface{}, error)

type APILDAPRoleMap

type APILDAPRoleMap []APILDAPRoleMapping

func (*APILDAPRoleMap) BuildFromService

func (a *APILDAPRoleMap) BuildFromService(h interface{}) error

func (*APILDAPRoleMap) ToService

func (a *APILDAPRoleMap) ToService() (interface{}, error)

type APILDAPRoleMapping

type APILDAPRoleMapping struct {
	LDAPGroup *string `json:"ldap_group"`
	RoleID    *string ` json:"role_id"`
}

func (*APILDAPRoleMapping) BuildFromService

func (a *APILDAPRoleMapping) BuildFromService(h interface{}) error

func (*APILDAPRoleMapping) ToService

func (a *APILDAPRoleMapping) ToService() (interface{}, error)

type APILogBuffering

type APILogBuffering struct {
	DurationSeconds int `json:"duration_seconds"`
	Count           int `json:"count"`
}

func (*APILogBuffering) BuildFromService

func (a *APILogBuffering) BuildFromService(h interface{}) error

func (*APILogBuffering) ToService

func (a *APILogBuffering) ToService() (interface{}, error)

type APILoggerConfig

type APILoggerConfig struct {
	Buffer              *APILogBuffering `json:"buffer"`
	DefaultLevel        *string          `json:"default_level"`
	ThresholdLevel      *string          `json:"threshold_level"`
	LogkeeperURL        *string          `json:"logkeeper_url"`
	BuildloggerBaseURL  *string          `json:"buildlogger_base_url"`
	BuildloggerRPCPort  *string          `json:"buildlogger_rpc_port"`
	BuildloggerUser     *string          `json:"buildlogger_user"`
	BuildloggerPassword *string          `json:"buildlogger_password"`
	BuildloggerAPIKey   *string          `json:"buildlogger_api_key"`
	DefaultLogger       *string          `json:"default_logger"`
}

func (*APILoggerConfig) BuildFromService

func (a *APILoggerConfig) BuildFromService(h interface{}) error

func (*APILoggerConfig) ToService

func (a *APILoggerConfig) ToService() (interface{}, error)

type APIModule

type APIModule struct {
	Module *string `json:"module"`
	Issue  *string `json:"issue"`
}

func ParseGitHubCommentModules

func ParseGitHubCommentModules(comment string) []APIModule

type APIModulePatch

type APIModulePatch struct {
	BranchName *string    `json:"branch_name"`
	HTMLLink   *string    `json:"html_link"`
	RawLink    *string    `json:"raw_link"`
	FileDiffs  []FileDiff `json:"file_diffs"`
}

type APIMultiAuthConfig

type APIMultiAuthConfig struct {
	ReadWrite []string `json:"read_write"`
	ReadOnly  []string `json:"read_only"`
}

func (*APIMultiAuthConfig) BuildFromService

func (a *APIMultiAuthConfig) BuildFromService(h interface{}) error

func (*APIMultiAuthConfig) ToService

func (a *APIMultiAuthConfig) ToService() (interface{}, error)

type APINaiveAuthConfig

type APINaiveAuthConfig struct {
	Users []APIAuthUser `json:"users"`
}

func (*APINaiveAuthConfig) BuildFromService

func (a *APINaiveAuthConfig) BuildFromService(h interface{}) error

func (*APINaiveAuthConfig) ToService

func (a *APINaiveAuthConfig) ToService() (interface{}, error)

type APINewRelicConfig

type APINewRelicConfig struct {
	AccountID     *string `json:"accountId"`
	TrustKey      *string `json:"trustKey"`
	AgentID       *string `json:"agentId"`
	LicenseKey    *string `json:"licenseKey"`
	ApplicationID *string `json:"applicationId"`
}

func (*APINewRelicConfig) BuildFromService

func (a *APINewRelicConfig) BuildFromService(h interface{}) error

BuildFromService builds a model from the service layer

func (*APINewRelicConfig) ToService

func (a *APINewRelicConfig) ToService() (interface{}, error)

ToService returns a service model from an API model

type APINotificationPreferences

type APINotificationPreferences struct {
	BuildBreak            *string `json:"build_break"`
	BuildBreakID          *string `json:"build_break_id,omitempty"`
	PatchFinish           *string `json:"patch_finish"`
	PatchFinishID         *string `json:"patch_finish_id,omitempty"`
	PatchFirstFailure     *string `json:"patch_first_failure"`
	PatchFirstFailureID   *string `json:"patch_first_failure_id,omitempty"`
	SpawnHostExpiration   *string `json:"spawn_host_expiration"`
	SpawnHostExpirationID *string `json:"spawn_host_expiration_id,omitempty"`
	SpawnHostOutcome      *string `json:"spawn_host_outcome"`
	SpawnHostOutcomeID    *string `json:"spawn_host_outcome_id,omitempty"`
	CommitQueue           *string `json:"commit_queue"`
	CommitQueueID         *string `json:"commit_queue_id,omitempty"`
}

func (*APINotificationPreferences) BuildFromService

func (n *APINotificationPreferences) BuildFromService(h interface{}) error

func (*APINotificationPreferences) ToService

func (n *APINotificationPreferences) ToService() (interface{}, error)

type APINotifyConfig

type APINotifyConfig struct {
	BufferTargetPerInterval int           `json:"buffer_target_per_interval"`
	BufferIntervalSeconds   int           `json:"buffer_interval_seconds"`
	EventProcessingLimit    int           `json:"event_processing_limit"`
	SMTP                    APISMTPConfig `json:"smtp"`
}

func (*APINotifyConfig) BuildFromService

func (a *APINotifyConfig) BuildFromService(h interface{}) error

func (*APINotifyConfig) ToService

func (a *APINotifyConfig) ToService() (interface{}, error)

type APIOktaConfig

type APIOktaConfig struct {
	ClientID           *string `json:"client_id"`
	ClientSecret       *string `json:"client_secret"`
	Issuer             *string `json:"issuer"`
	UserGroup          *string `json:"user_group"`
	ExpireAfterMinutes int     `json:"expire_after_minutes"`
}

func (*APIOktaConfig) BuildFromService

func (a *APIOktaConfig) BuildFromService(h interface{}) error

func (*APIOktaConfig) ToService

func (a *APIOktaConfig) ToService() (interface{}, error)

type APIOnlyAPIAuthConfig

type APIOnlyAPIAuthConfig struct {
	Users []APIOnlyAPIUser `json:"users"`
}

func (*APIOnlyAPIAuthConfig) BuildFromService

func (a *APIOnlyAPIAuthConfig) BuildFromService(h interface{}) error

func (*APIOnlyAPIAuthConfig) ToService

func (a *APIOnlyAPIAuthConfig) ToService() (interface{}, error)

type APIOnlyAPIUser

type APIOnlyAPIUser struct {
	Username *string  `json:"username"`
	Key      *string  `json:"key"`
	Roles    []string `json:"roles"`
}

func (*APIOnlyAPIUser) BuildFromService

func (a *APIOnlyAPIUser) BuildFromService(h interface{}) error

func (*APIOnlyAPIUser) ToService

func (a *APIOnlyAPIUser) ToService() (interface{}, error)

type APIOomTrackerInfo

type APIOomTrackerInfo struct {
	Detected bool  `json:"detected"`
	Pids     []int `json:"pids"`
}

func (*APIOomTrackerInfo) BuildFromService

func (at *APIOomTrackerInfo) BuildFromService(t interface{}) error

func (*APIOomTrackerInfo) ToService

func (ad *APIOomTrackerInfo) ToService() (interface{}, error)

type APIOpenStackConfig

type APIOpenStackConfig struct {
	IdentityEndpoint *string `json:"identity_endpoint"`

	Username   *string `json:"username"`
	Password   *string `json:"password"`
	DomainName *string `json:"domain_name"`

	ProjectName *string `json:"project_name"`
	ProjectID   *string `json:"project_id"`

	Region *string `json:"region"`
}

func (*APIOpenStackConfig) BuildFromService

func (a *APIOpenStackConfig) BuildFromService(h interface{}) error

func (*APIOpenStackConfig) ToService

func (a *APIOpenStackConfig) ToService() (interface{}, error)

type APIPRInfo

type APIPRInfo struct {
	Owner       *string `json:"owner" mapstructure:"owner"`
	Repo        *string `json:"repo" mapstructure:"repo"`
	PRNumber    int     `json:"pr_number" mapstructure:"pr_number"`
	Ref         *string `json:"ref" mapstructure:"ref"`
	CommitTitle *string `json:"commit_title" mapstructure:"commit_title"`
}

func (*APIPRInfo) BuildFromService

func (s *APIPRInfo) BuildFromService(h interface{}) error

func (*APIPRInfo) ToService

func (s *APIPRInfo) ToService() (interface{}, error)

type APIPatch

type APIPatch struct {
	Id                *string          `json:"patch_id"`
	Description       *string          `json:"description"`
	ProjectId         *string          `json:"project_id"`
	Branch            *string          `json:"branch"`
	Githash           *string          `json:"git_hash"`
	PatchNumber       int              `json:"patch_number"`
	Author            *string          `json:"author"`
	Version           *string          `json:"version"`
	Status            *string          `json:"status"`
	CreateTime        *time.Time       `json:"create_time"`
	StartTime         *time.Time       `json:"start_time"`
	FinishTime        *time.Time       `json:"finish_time"`
	Variants          []*string        `json:"builds"`
	Tasks             []*string        `json:"tasks"`
	VariantsTasks     []VariantTask    `json:"variants_tasks"`
	Activated         bool             `json:"activated"`
	Alias             *string          `json:"alias,omitempty"`
	GithubPatchData   githubPatch      `json:"github_patch_data,omitempty"`
	ModuleCodeChanges []APIModulePatch `json:"module_code_changes"`
	PatchedConfig     *string          `json:"patched_config"`
	Project           *string          `json:"project"`
}

APIPatch is the model to be returned by the API whenever patches are fetched.

func (*APIPatch) BuildFromService

func (apiPatch *APIPatch) BuildFromService(h interface{}) error

BuildFromService converts from service level structs to an APIPatch

func (*APIPatch) ToService

func (apiPatch *APIPatch) ToService() (interface{}, error)

ToService converts a service layer patch using the data from APIPatch

type APIPermission

type APIPermission struct {
	Key    string                      `json:"key"`
	Name   string                      `json:"name"`
	Levels []evergreen.PermissionLevel `json:"levels"`
}

type APIPermissions

type APIPermissions struct {
	ProjectPermissions []APIPermission `json:"projectPermissions"`
	DistroPermissions  []APIPermission `json:"distroPermissions"`
}

type APIPlannerSettings

type APIPlannerSettings struct {
	Version                   *string     `json:"version"`
	TargetTime                APIDuration `json:"target_time"`
	GroupVersions             *bool       `json:"group_versions"`
	PatchFactor               int64       `json:"patch_factor"`
	PatchTimeInQueueFactor    int64       `json:"patch_time_in_queue_factor"`
	MainlineTimeInQueueFactor int64       `json:"mainline_time_in_queue_factor"`
	ExpectedRuntimeFactor     int64       `json:"expected_runtime_factor"`
}

func (*APIPlannerSettings) BuildFromService

func (s *APIPlannerSettings) BuildFromService(h interface{}) error

BuildFromService converts from service level distro.PlannerSetting to an APIPlannerSettings

func (*APIPlannerSettings) ToService

func (s *APIPlannerSettings) ToService() (interface{}, error)

ToService returns a service layer distro.PlannerSettings using the data from APIPlannerSettings

type APIProject

type APIProject struct {
	BatchTime             int                  `json:"batch_time"`
	Branch                *string              `json:"branch_name"`
	DisplayName           *string              `json:"display_name"`
	Enabled               bool                 `json:"enabled"`
	RepotrackerDisabled   bool                 `json:"repotracker_disabled"`
	Identifier            *string              `json:"identifier"`
	Owner                 *string              `json:"owner_name"`
	Private               bool                 `json:"private"`
	RemotePath            *string              `json:"remote_path"`
	Repo                  *string              `json:"repo_name"`
	Tracked               bool                 `json:"tracked"`
	DeactivatePrevious    bool                 `json:"deactivate_previous"`
	Admins                []*string            `json:"admins"`
	Tags                  []*string            `json:"tags"`
	TracksPushEvents      bool                 `json:"tracks_push_events"`
	PRTestingEnabled      bool                 `json:"pr_testing_enabled"`
	GitTagVersionsEnabled bool                 `json:"git_tag_versions_enabled"`
	CommitQueue           APICommitQueueParams `json:"commit_queue"`
}

func (*APIProject) BuildFromService

func (apiProject *APIProject) BuildFromService(p interface{}) error

func (*APIProject) ToService

func (apiProject *APIProject) ToService() (interface{}, error)

type APIProjectAlias

type APIProjectAlias struct {
	Alias       *string   `json:"alias"`
	GitTag      *string   `json:"git_tag"`
	Variant     *string   `json:"variant"`
	Task        *string   `json:"task"`
	RemotePath  *string   `json:"remote_path"`
	VariantTags []*string `json:"variant_tags,omitempty"`
	TaskTags    []*string `json:"tags,omitempty"`
	Delete      bool      `json:"delete,omitempty"`
	ID          *string   `json:"_id,omitempty"`
}

func DbProjectAliasesToRestModel

func DbProjectAliasesToRestModel(aliases []model.ProjectAlias) []APIProjectAlias

func (*APIProjectAlias) BuildFromService

func (a *APIProjectAlias) BuildFromService(h interface{}) error

func (*APIProjectAlias) ToService

func (a *APIProjectAlias) ToService() (interface{}, error)

type APIProjectEvent

type APIProjectEvent struct {
	Timestamp *time.Time         `json:"ts"`
	User      *string            `json:"user"`
	Before    APIProjectSettings `json:"before"`
	After     APIProjectSettings `json:"after"`
}

func (*APIProjectEvent) BuildFromService

func (e *APIProjectEvent) BuildFromService(h interface{}) error

func (*APIProjectEvent) ToService

func (e *APIProjectEvent) ToService() (interface{}, error)

type APIProjectRef

type APIProjectRef struct {
	Owner                       *string              `json:"owner_name"`
	Repo                        *string              `json:"repo_name"`
	Branch                      *string              `json:"branch_name"`
	RepoKind                    *string              `json:"repo_kind"`
	Enabled                     bool                 `json:"enabled"`
	Private                     bool                 `json:"private"`
	BatchTime                   int                  `json:"batch_time"`
	RemotePath                  *string              `json:"remote_path"`
	Identifier                  *string              `json:"identifier"`
	DisplayName                 *string              `json:"display_name"`
	DeactivatePrevious          bool                 `json:"deactivate_previous"`
	TracksPushEvents            bool                 `json:"tracks_push_events"`
	PRTestingEnabled            bool                 `json:"pr_testing_enabled"`
	GitTagVersionsEnabled       bool                 `json:"git_tag_versions_enabled"`
	DefaultLogger               *string              `json:"default_logger"`
	CommitQueue                 APICommitQueueParams `json:"commit_queue"`
	TaskSync                    APITaskSyncOptions   `json:"task_sync"`
	Tracked                     bool                 `json:"tracked"`
	PatchingDisabled            bool                 `json:"patching_disabled"`
	RepotrackerDisabled         bool                 `json:"repotracker_disabled"`
	DispatchingDisabled         bool                 `json:"dispatching_disabled"`
	Admins                      []*string            `json:"admins"`
	DeleteAdmins                []*string            `json:"delete_admins,omitempty"`
	GitTagAuthorizedUsers       []*string            `bson:"git_tag_authorized_users" json:"git_tag_authorized_users"`
	DeleteGitTagAuthorizedUsers []*string            `bson:"delete_git_tag_authorized_users,omitempty" json:"delete_git_tag_authorized_users,omitempty"`
	NotifyOnBuildFailure        bool                 `json:"notify_on_failure"`
	Tags                        []*string            `json:"tags"`

	Revision            *string                `json:"revision"`
	Triggers            []APITriggerDefinition `json:"triggers"`
	Aliases             []APIProjectAlias      `json:"aliases"`
	Variables           APIProjectVars         `json:"variables"`
	WorkstationConfig   APIWorkstationConfig   `json:"workstation_config"`
	Subscriptions       []APISubscription      `json:"subscriptions"`
	DeleteSubscriptions []*string              `json:"delete_subscriptions,omitempty"`
}

func (*APIProjectRef) BuildFromService

func (p *APIProjectRef) BuildFromService(v interface{}) error

func (*APIProjectRef) ToService

func (p *APIProjectRef) ToService() (interface{}, error)

ToService returns a service layer ProjectRef using the data from APIProjectRef

type APIProjectSettings

type APIProjectSettings struct {
	ProjectRef            APIProjectRef     `json:"proj_ref"`
	GitHubWebhooksEnabled bool              `json:"github_webhooks_enabled"`
	Vars                  APIProjectVars    `json:"vars"`
	Aliases               []APIProjectAlias `json:"aliases"`
	Subscriptions         []APISubscription `json:"subscriptions"`
}

func DbProjectSettingsToRestModel

func DbProjectSettingsToRestModel(settings model.ProjectSettingsEvent) (APIProjectSettings, error)

type APIProjectVars

type APIProjectVars struct {
	Vars           map[string]string `json:"vars"`
	PrivateVars    map[string]bool   `json:"private_vars"`
	RestrictedVars map[string]bool   `json:"restricted_vars"`
	VarsToDelete   []string          `json:"vars_to_delete,omitempty"`
}

func (*APIProjectVars) BuildFromService

func (p *APIProjectVars) BuildFromService(h interface{}) error

func (*APIProjectVars) ToService

func (p *APIProjectVars) ToService() (interface{}, error)

type APIPubKey

type APIPubKey struct {
	Name *string `json:"name"`
	Key  *string `json:"key"`
}

func (*APIPubKey) BuildFromService

func (apiPubKey *APIPubKey) BuildFromService(h interface{}) error

BuildFromService converts from service level structs to an APIPubKey.

func (*APIPubKey) ToService

func (apiPubKey *APIPubKey) ToService() (interface{}, error)

ToService returns a service layer public key using the data from APIPubKey.

type APIQuestionAnswer

type APIQuestionAnswer struct {
	ID     *string `json:"id"`
	Prompt *string `json:"prompt"`
	Answer *string `json:"answer"`
}

func (*APIQuestionAnswer) BuildFromService

func (a *APIQuestionAnswer) BuildFromService(h interface{}) error

func (*APIQuestionAnswer) ToService

func (a *APIQuestionAnswer) ToService() (interface{}, error)

type APIRecentTaskStats

type APIRecentTaskStats struct {
	Total              int `json:"total"`
	Inactive           int `json:"inactive"`
	Unstarted          int `json:"unstarted"`
	Started            int `json:"started"`
	Succeeded          int `json:"succeeded"`
	Failed             int `json:"failed"`
	SystemFailed       int `json:"system-failed"`
	SetupFailed        int `json:"setup-failed"`
	SystemUnresponsive int `json:"system-unresponsive"`
	SystemTimedOut     int `json:"system-timed-out"`
	TestTimedOut       int `json:"test-timed-out"`
}

APIRecentTaskStats is the model to be returned by the API whenever recent tasks are fetched.

func (*APIRecentTaskStats) BuildFromService

func (apiStatus *APIRecentTaskStats) BuildFromService(h interface{}) error

BuildFromService converts from service level structs to an APIRecentTaskStats.

func (*APIRecentTaskStats) ToService

func (apiStatus *APIRecentTaskStats) ToService() (interface{}, error)

ToService returns a service layer distro using the data from APIRecentTaskStats.

type APIRecentTaskStatsList

type APIRecentTaskStatsList map[string][]APIStat

func (*APIRecentTaskStatsList) BuildFromService

func (s *APIRecentTaskStatsList) BuildFromService(h interface{}) error

func (*APIRecentTaskStatsList) ToService

func (s *APIRecentTaskStatsList) ToService() (interface{}, error)

type APIRepoTrackerConfig

type APIRepoTrackerConfig struct {
	NumNewRepoRevisionsToFetch int `json:"revs_to_fetch"`
	MaxRepoRevisionsToSearch   int `json:"max_revs_to_search"`
	MaxConcurrentRequests      int `json:"max_con_requests"`
}

func (*APIRepoTrackerConfig) BuildFromService

func (a *APIRepoTrackerConfig) BuildFromService(h interface{}) error

func (*APIRepoTrackerConfig) ToService

func (a *APIRepoTrackerConfig) ToService() (interface{}, error)

type APIResourceLimits

type APIResourceLimits struct {
	NumFiles        int `json:"num_files"`
	NumProcesses    int `json:"num_processes"`
	LockedMemoryKB  int `json:"locked_memory"`
	VirtualMemoryKB int `json:"virtual_memory"`
}

type APIS3Credentials

type APIS3Credentials struct {
	Key    *string `json:"key"`
	Secret *string `json:"secret"`
	Bucket *string `json:"bucket"`
}

func (*APIS3Credentials) BuildFromService

func (a *APIS3Credentials) BuildFromService(h interface{}) error

func (*APIS3Credentials) ToService

func (a *APIS3Credentials) ToService() (interface{}, error)

type APISMTPConfig

type APISMTPConfig struct {
	Server     *string   `json:"server"`
	Port       int       `json:"port"`
	UseSSL     bool      `json:"use_ssl"`
	Username   *string   `json:"username"`
	Password   *string   `json:"password"`
	From       *string   `json:"from"`
	AdminEmail []*string `json:"admin_email"`
}

func (*APISMTPConfig) BuildFromService

func (a *APISMTPConfig) BuildFromService(h interface{}) error

func (*APISMTPConfig) ToService

func (a *APISMTPConfig) ToService() (interface{}, error)

type APISSHKeyPair

type APISSHKeyPair struct {
	Name    *string `json:"name"`
	Public  *string `json:"public"`
	Private *string `json:"private"`
}

type APISchedulerConfig

type APISchedulerConfig struct {
	TaskFinder                    *string `json:"task_finder"`
	HostAllocator                 *string `json:"host_allocator"`
	FreeHostFraction              float64 `json:"free_host_fraction"`
	CacheDurationSeconds          int     `json:"cache_duration_seconds"`
	Planner                       *string `json:"planner"`
	TargetTimeSeconds             int     `json:"target_time_seconds"`
	AcceptableHostIdleTimeSeconds int     `json:"acceptable_host_idle_time_seconds"`
	GroupVersions                 bool    `json:"group_versions"`
	PatchFactor                   int64   `json:"patch_factor"`
	PatchTimeInQueueFactor        int64   `json:"patch_time_in_queue_factor"`
	CommitQueueFactor             int64   `json:"commit_queue_factor"`
	MainlineTimeInQueueFactor     int64   `json:"mainline_time_in_queue_factor"`
	ExpectedRuntimeFactor         int64   `json:"expected_runtime_factor"`
}

func (*APISchedulerConfig) BuildFromService

func (a *APISchedulerConfig) BuildFromService(h interface{}) error

func (*APISchedulerConfig) ToService

func (a *APISchedulerConfig) ToService() (interface{}, error)

type APISelector

type APISelector struct {
	Type *string `json:"type"`
	Data *string `json:"data"`
}

func (*APISelector) BuildFromService

func (s *APISelector) BuildFromService(h interface{}) error

func (*APISelector) ToService

func (s *APISelector) ToService() (interface{}, error)

type APIServiceFlags

type APIServiceFlags struct {
	TaskDispatchDisabled          bool `json:"task_dispatch_disabled"`
	HostInitDisabled              bool `json:"host_init_disabled"`
	MonitorDisabled               bool `json:"monitor_disabled"`
	AlertsDisabled                bool `json:"alerts_disabled"`
	AgentStartDisabled            bool `json:"agent_start_disabled"`
	RepotrackerDisabled           bool `json:"repotracker_disabled"`
	SchedulerDisabled             bool `json:"scheduler_disabled"`
	GithubPRTestingDisabled       bool `json:"github_pr_testing_disabled"`
	CLIUpdatesDisabled            bool `json:"cli_updates_disabled"`
	BackgroundStatsDisabled       bool `json:"background_stats_disabled"`
	TaskLoggingDisabled           bool `json:"task_logging_disabled"`
	CacheStatsJobDisabled         bool `json:"cache_stats_job_disabled"`
	CacheStatsEndpointDisabled    bool `json:"cache_stats_endpoint_disabled"`
	CacheStatsOldTasksDisabled    bool `json:"cache_stats_old_tasks_disabled"`
	TaskReliabilityDisabled       bool `json:"task_reliability_disabled"`
	CommitQueueDisabled           bool `json:"commit_queue_disabled"`
	PlannerDisabled               bool `json:"planner_disabled"`
	HostAllocatorDisabled         bool `json:"host_allocator_disabled"`
	DRBackupDisabled              bool `json:"dr_backup_disabled"`
	BackgroundReauthDisabled      bool `json:"background_reauth_disabled"`
	BackgroundCleanupDisabled     bool `json:"background_cleanup_disabled"`
	AmboyRemoteManagementDisabled bool `json:"amboy_remote_management_disabled"`

	// Notifications Flags
	EventProcessingDisabled      bool `json:"event_processing_disabled"`
	JIRANotificationsDisabled    bool `json:"jira_notifications_disabled"`
	SlackNotificationsDisabled   bool `json:"slack_notifications_disabled"`
	EmailNotificationsDisabled   bool `json:"email_notifications_disabled"`
	WebhookNotificationsDisabled bool `json:"webhook_notifications_disabled"`
	GithubStatusAPIDisabled      bool `json:"github_status_api_disabled"`
}

APIServiceFlags is a public structure representing the admin service flags

func (*APIServiceFlags) BuildFromService

func (as *APIServiceFlags) BuildFromService(h interface{}) error

BuildFromService builds a model from the service layer

func (*APIServiceFlags) ToService

func (as *APIServiceFlags) ToService() (interface{}, error)

ToService returns a service model from an API model

type APISlack

type APISlack struct {
	Target      *string              `json:"target"`
	Msg         *string              `json:"msg"`
	Attachments []APISlackAttachment `json:"attachments"`
}

func (*APISlack) BuildFromService

func (n *APISlack) BuildFromService(h interface{}) error

BuildFromService converts from service level message.Slack to APISlack.

func (*APISlack) ToService

func (n *APISlack) ToService() (interface{}, error)

ToService is not implemented

type APISlackAttachment

type APISlackAttachment struct {
	Color      *string                   `json:"color"`
	Fallback   *string                   `json:"fallback"`
	AuthorName *string                   `json:"author_name"`
	AuthorIcon *string                   `json:"author_icon"`
	Title      *string                   `json:"title"`
	TitleLink  *string                   `json:"title_link"`
	Text       *string                   `json:"text"`
	Fields     []APISlackAttachmentField `json:"fields"`
	MarkdownIn []string                  `json:"mrkdwn_in"`
	Footer     *string                   `json:"footer"`
}

func (*APISlackAttachment) BuildFromService

func (a *APISlackAttachment) BuildFromService(h interface{}) error

BuildFromService converts from service level message.SlackAttachment to APISlackAttachment.

func (*APISlackAttachment) ToService

func (a *APISlackAttachment) ToService() (interface{}, error)

ToService returns a service layer message.SlackAttachment using the data from APISlackAttachment.

type APISlackAttachmentField

type APISlackAttachmentField struct {
	Title *string `json:"title"`
	Value *string `json:"value"`
	Short bool    `json:"short"`
}

func (*APISlackAttachmentField) BuildFromService

func (f *APISlackAttachmentField) BuildFromService(h interface{}) error

BuildFromService converts from service level message.SlackAttachmentField to an APISlackAttachmentField.

func (*APISlackAttachmentField) ToService

func (f *APISlackAttachmentField) ToService() (interface{}, error)

ToService returns a service layer message.SlackAttachmentField using the data from APISlackAttachmentField.

type APISlackConfig

type APISlackConfig struct {
	Options *APISlackOptions `json:"options"`
	Token   *string          `json:"token"`
	Level   *string          `json:"level"`
}

func (*APISlackConfig) BuildFromService

func (a *APISlackConfig) BuildFromService(h interface{}) error

func (*APISlackConfig) ToService

func (a *APISlackConfig) ToService() (interface{}, error)

type APISlackOptions

type APISlackOptions struct {
	Channel       *string         `json:"channel"`
	Hostname      *string         `json:"hostname"`
	Name          *string         `json:"name"`
	Username      *string         `json:"username"`
	IconURL       *string         `json:"icon_url"`
	BasicMetadata bool            `json:"add_basic_metadata"`
	Fields        bool            `json:"use_fields"`
	AllFields     bool            `json:"all_fields"`
	FieldsSet     map[string]bool `json:"fields"`
}

func (*APISlackOptions) BuildFromService

func (a *APISlackOptions) BuildFromService(h interface{}) error

func (*APISlackOptions) ToService

func (a *APISlackOptions) ToService() (interface{}, error)

type APISpawnHostConfig

type APISpawnHostConfig struct {
	UnexpirableHostsPerUser   *int `json:"unexpirable_hosts_per_user"`
	UnexpirableVolumesPerUser *int `json:"unexpirable_volumes_per_user"`
	SpawnHostsPerUser         *int `json:"spawn_hosts_per_user"`
}

func (*APISpawnHostConfig) BuildFromService

func (c *APISpawnHostConfig) BuildFromService(h interface{}) error

func (*APISpawnHostConfig) ToService

func (c *APISpawnHostConfig) ToService() (interface{}, error)

type APISpawnHostModify

type APISpawnHostModify struct {
	Action       *string    `json:"action"`
	HostID       *string    `json:"host_id"`
	VolumeID     *string    `json:"volume_id"`
	RDPPwd       *string    `json:"rdp_pwd"`
	AddHours     *string    `json:"add_hours"`
	Expiration   *time.Time `json:"expiration"`
	InstanceType *string    `json:"instance_type"`
	AddTags      []*string  `json:"tags_to_add"`
	DeleteTags   []*string  `json:"tags_to_delete"`
	NewName      *string    `json:"new_name"`
}

type APISplunkConnectionInfo

type APISplunkConnectionInfo struct {
	ServerURL *string `json:"url"`
	Token     *string `json:"token"`
	Channel   *string `json:"channel"`
}

func (*APISplunkConnectionInfo) BuildFromService

func (a *APISplunkConnectionInfo) BuildFromService(h interface{}) error

func (*APISplunkConnectionInfo) ToService

func (a *APISplunkConnectionInfo) ToService() (interface{}, error)

type APIStat

type APIStat struct {
	Name  *string `json:"name"`
	Count int     `json:"count"`
}

type APIStatList

type APIStatList []APIStat

func (*APIStatList) BuildFromService

func (s *APIStatList) BuildFromService(h interface{}) error

type APISubnet

type APISubnet struct {
	AZ       *string `json:"az"`
	SubnetID *string `json:"subnet_id"`
}

func (*APISubnet) BuildFromService

func (a *APISubnet) BuildFromService(h interface{}) error

func (*APISubnet) ToService

func (a *APISubnet) ToService() (interface{}, error)

type APISubscriber

type APISubscriber struct {
	Type   *string     `json:"type"`
	Target interface{} `json:"target"`
}

func (*APISubscriber) BuildFromService

func (s *APISubscriber) BuildFromService(h interface{}) error

func (*APISubscriber) ToService

func (s *APISubscriber) ToService() (interface{}, error)

type APISubscription

type APISubscription struct {
	ID             *string           `json:"id"`
	ResourceType   *string           `json:"resource_type"`
	Trigger        *string           `json:"trigger"`
	Selectors      []APISelector     `json:"selectors"`
	RegexSelectors []APISelector     `json:"regex_selectors"`
	Subscriber     APISubscriber     `json:"subscriber"`
	OwnerType      *string           `json:"owner_type"`
	Owner          *string           `json:"owner"`
	TriggerData    map[string]string `json:"trigger_data,omitempty"`
}

func DbProjectSubscriptionsToRestModel

func DbProjectSubscriptionsToRestModel(subscriptions []event.Subscription) ([]APISubscription, error)

func (*APISubscription) BuildFromService

func (s *APISubscription) BuildFromService(h interface{}) error

func (*APISubscription) ToService

func (s *APISubscription) ToService() (interface{}, error)

type APISyncAtEndOptions

type APISyncAtEndOptions struct {
	Enabled  bool          `json:"enabled"`
	Statuses []string      `json:"statuses"`
	Timeout  time.Duration `json:"timeout"`
}

type APITask

type APITask struct {
	Id                 *string             `json:"task_id"`
	ProjectId          *string             `json:"project_id"`
	CreateTime         *time.Time          `json:"create_time"`
	DispatchTime       *time.Time          `json:"dispatch_time"`
	ScheduledTime      *time.Time          `json:"scheduled_time"`
	StartTime          *time.Time          `json:"start_time"`
	FinishTime         *time.Time          `json:"finish_time"`
	IngestTime         *time.Time          `json:"ingest_time"`
	ActivatedTime      *time.Time          `json:"activated_time"`
	Version            *string             `json:"version_id"`
	Revision           *string             `json:"revision"`
	Priority           int64               `json:"priority"`
	Activated          bool                `json:"activated"`
	ActivatedBy        *string             `json:"activated_by"`
	BuildId            *string             `json:"build_id"`
	DistroId           *string             `json:"distro_id"`
	BuildVariant       *string             `json:"build_variant"`
	DependsOn          []APIDependency     `json:"depends_on"`
	DisplayName        *string             `json:"display_name"`
	HostId             *string             `json:"host_id"`
	HostLink           *string             `json:"host_link"`
	Restarts           int                 `json:"restarts"`
	Execution          int                 `json:"execution"`
	Order              int                 `json:"order"`
	Status             *string             `json:"status"`
	DisplayStatus      *string             `json:"display_status"`
	Details            ApiTaskEndDetail    `json:"status_details"`
	Logs               LogLinks            `json:"logs"`
	TimeTaken          APIDuration         `json:"time_taken_ms"`
	ExpectedDuration   APIDuration         `json:"expected_duration_ms"`
	EstimatedStart     APIDuration         `json:"est_wait_to_start_ms"`
	EstimatedCost      float64             `json:"estimated_cost"`
	PreviousExecutions []APITask           `json:"previous_executions,omitempty"`
	GenerateTask       bool                `json:"generate_task"`
	GeneratedBy        string              `json:"generated_by"`
	Artifacts          []APIFile           `json:"artifacts"`
	DisplayOnly        bool                `json:"display_only"`
	ExecutionTasks     []*string           `json:"execution_tasks,omitempty"`
	Mainline           bool                `json:"mainline"`
	TaskGroup          string              `json:"task_group,omitempty"`
	TaskGroupMaxHosts  int                 `json:"task_group_max_hosts,omitempty"`
	Blocked            bool                `json:"blocked"`
	Requester          *string             `json:"requester"`
	TestResults        []APITest           `json:"test_results"`
	Aborted            bool                `json:"aborted"`
	CanSync            bool                `json:"can_sync,omitempty"`
	SyncAtEndOpts      APISyncAtEndOptions `json:"sync_at_end_opts"`
}

APITask is the model to be returned by the API whenever tasks are fetched.

func (*APITask) BuildFromService

func (at *APITask) BuildFromService(t interface{}) error

BuildFromService converts from a service level task by loading the data into the appropriate fields of the APITask.

func (*APITask) BuildPreviousExecutions

func (at *APITask) BuildPreviousExecutions(tasks []task.Task, url string) error

func (*APITask) GetArtifacts

func (at *APITask) GetArtifacts() error

func (*APITask) ToService

func (ad *APITask) ToService() (interface{}, error)

ToService returns a service layer task using the data from the APITask.

type APITaskCache

type APITaskCache struct {
	Id              string                  `json:"id"`
	DisplayName     string                  `json:"display_name"`
	Status          string                  `json:"status"`
	StatusDetails   apimodels.TaskEndDetail `json:"task_end_details"`
	StartTime       *time.Time              `json:"start_time"`
	TimeTaken       time.Duration           `json:"time_taken"`
	Activated       bool                    `json:"activated"`
	FailedTestNames []string                `json:"failed_test_names,omitempty"`
}

type APITaskCost

type APITaskCost struct {
	Id            *string     `json:"task_id"`
	DisplayName   *string     `json:"display_name"`
	DistroId      *string     `json:"distro"`
	BuildVariant  *string     `json:"build_variant"`
	TimeTaken     APIDuration `json:"time_taken"`
	Githash       *string     `json:"githash"`
	EstimatedCost float64     `json:"estimated_cost"`
}

APITaskCost is the model to be returned by the API whenever tasks for the cost route are fetched.

func (*APITaskCost) BuildFromService

func (atc *APITaskCost) BuildFromService(t interface{}) error

BuildFromService converts from a service level task by loading the data into the appropriate fields of the APITaskCost. (It leaves out fields unnecessary for the route.)

func (*APITaskCost) ToService

func (atc *APITaskCost) ToService() (interface{}, error)

ToService returns a service layer version cost using the data from APIVersionCost.

type APITaskReliability

type APITaskReliability struct {
	TaskName     *string `json:"task_name"`
	BuildVariant *string `json:"variant,omitempty"`
	Distro       *string `json:"distro,omitempty"`
	Date         *string `json:"date"`

	NumSuccess         int     `json:"num_success"`
	NumFailed          int     `json:"num_failed"`
	NumTotal           int     `json:"num_total"`
	NumTimeout         int     `json:"num_timeout"`
	NumTestFailed      int     `json:"num_test_failed"`
	NumSystemFailed    int     `json:"num_system_failed"`
	NumSetupFailed     int     `json:"num_setup_failed"`
	AvgDurationSuccess float64 `json:"avg_duration_success"`
	SuccessRate        float64 `json:"success_rate"`
}

APITaskReliability is the model to be returned by the API when querying task execution statistics

func (*APITaskReliability) BuildFromService

func (apiTaskReliability *APITaskReliability) BuildFromService(h interface{}) error

Converts a service level struct to an API level struct

func (*APITaskReliability) StartAtKey

func (apiTaskReliability *APITaskReliability) StartAtKey() string

StartAtKey returns the start_at key parameter that can be used to paginate and start at this element.

func (*APITaskReliability) ToService

func (apiTaskReliability *APITaskReliability) ToService() (interface{}, error)

ToService is not implemented for APITaskStats.

type APITaskStats

type APITaskStats struct {
	TaskName     *string `json:"task_name"`
	BuildVariant *string `json:"variant,omitempty"`
	Distro       *string `json:"distro,omitempty"`
	Date         *string `json:"date"`

	NumSuccess         int     `json:"num_success"`
	NumFailed          int     `json:"num_failed"`
	NumTotal           int     `json:"num_total"`
	NumTimeout         int     `json:"num_timeout"`
	NumTestFailed      int     `json:"num_test_failed"`
	NumSystemFailed    int     `json:"num_system_failed"`
	NumSetupFailed     int     `json:"num_setup_failed"`
	AvgDurationSuccess float64 `json:"avg_duration_success"`
}

APITaskStats is the model to be returned by the API when querying task execution statistics

func (*APITaskStats) BuildFromService

func (apiTaskStats *APITaskStats) BuildFromService(h interface{}) error

Converts a service level struct to an API level struct

func (*APITaskStats) StartAtKey

func (apiTaskStats *APITaskStats) StartAtKey() string

StartAtKey returns the start_at key parameter that can be used to paginate and start at this element.

func (*APITaskStats) ToService

func (apiTaskStats *APITaskStats) ToService() (interface{}, error)

ToService is not implemented for APITaskStats.

type APITaskSyncOptions

type APITaskSyncOptions struct {
	ConfigEnabled bool `json:"config_enabled"`
	PatchEnabled  bool `json:"patch_enabled"`
}

func (*APITaskSyncOptions) BuildFromService

func (opts *APITaskSyncOptions) BuildFromService(h interface{}) error

func (*APITaskSyncOptions) ToService

func (opts *APITaskSyncOptions) ToService() (interface{}, error)

type APITest

type APITest struct {
	Id        *string    `json:"test_id"`
	TaskId    *string    `json:"task_id"`
	Status    *string    `json:"status"`
	TestFile  *string    `json:"test_file"`
	Logs      TestLogs   `json:"logs"`
	ExitCode  int        `json:"exit_code"`
	StartTime *time.Time `json:"start_time"`
	EndTime   *time.Time `json:"end_time"`
	Duration  float64    `json:"duration"`
}

APITest contains the data to be returned whenever a test is used in the API.

func (*APITest) BuildFromService

func (at *APITest) BuildFromService(st interface{}) error

func (*APITest) ToService

func (at *APITest) ToService() (interface{}, error)

type APITestStats

type APITestStats struct {
	TestFile     *string `json:"test_file"`
	TaskName     *string `json:"task_name,omitempty"`
	BuildVariant *string `json:"variant,omitempty"`
	Distro       *string `json:"distro,omitempty"`
	Date         *string `json:"date"`

	NumPass         int     `json:"num_pass"`
	NumFail         int     `json:"num_fail"`
	AvgDurationPass float64 `json:"avg_duration_pass"`
}

APITestStats is the model to be returned by the API when querying test execution statistics.

func (*APITestStats) BuildFromService

func (apiTestStats *APITestStats) BuildFromService(h interface{}) error

BuildFromService converts a service level struct to an API level struct.

func (*APITestStats) StartAtKey

func (apiTestStats *APITestStats) StartAtKey() string

StartAtKey returns the start_at key parameter that can be used to paginate and start at this element.

func (*APITestStats) ToService

func (apiTestStats *APITestStats) ToService() (interface{}, error)

ToService is not implemented for APITestStats.

type APITriggerConfig

type APITriggerConfig struct {
	GenerateTaskDistro *string `json:"generate_distro"`
}

func (*APITriggerConfig) BuildFromService

func (c *APITriggerConfig) BuildFromService(h interface{}) error

func (*APITriggerConfig) ToService

func (c *APITriggerConfig) ToService() (interface{}, error)

type APITriggerDefinition

type APITriggerDefinition struct {
	Project           *string `json:"project"`
	Level             *string `json:"level"` //build or task
	DefinitionID      *string `json:"definition_id"`
	BuildVariantRegex *string `json:"variant_regex"`
	TaskRegex         *string `json:"task_regex"`
	Status            *string `json:"status"`
	DateCutoff        *int    `json:"date_cutoff"`
	ConfigFile        *string `json:"config_file"`
	GenerateFile      *string `json:"generate_file"`
	Command           *string `json:"command"`
	Alias             *string `json:"alias"`
}

type APIUIConfig

type APIUIConfig struct {
	Url                     *string  `json:"url"`
	HelpUrl                 *string  `json:"help_url"`
	UIv2Url                 *string  `json:"uiv2_url"`
	HttpListenAddr          *string  `json:"http_listen_addr"`
	Secret                  *string  `json:"secret"`
	DefaultProject          *string  `json:"default_project"`
	CacheTemplates          bool     `json:"cache_templates"`
	CsrfKey                 *string  `json:"csrf_key"`
	CORSOrigins             []string `json:"cors_origins"`
	LoginDomain             *string  `json:"login_domain"`
	ExpireLoginCookieDomain *string  `json:"expire_domain"`
}

func (*APIUIConfig) BuildFromService

func (a *APIUIConfig) BuildFromService(h interface{}) error

func (*APIUIConfig) ToService

func (a *APIUIConfig) ToService() (interface{}, error)

type APIUseSpruceOptions

type APIUseSpruceOptions struct {
	HasUsedSpruceBefore bool `json:"has_used_spruce_before" bson:"has_used_spruce_before,omitempty"`
	SpruceV1            bool `json:"spruce_v1" bson:"spruce_v1,omitempty"`
}

type APIUser

type APIUser struct {
	DisplayName *string `json:"display_name"`
	UserID      *string `json:"user_id"`
}

func (*APIUser) BuildFromService

func (a *APIUser) BuildFromService(h interface{}) error

func (*APIUser) ToService

func (a *APIUser) ToService() (interface{}, error)

type APIUserSettings

type APIUserSettings struct {
	Timezone         *string                     `json:"timezone"`
	Region           *string                     `json:"region"`
	UseSpruceOptions *APIUseSpruceOptions        `json:"use_spruce_options"`
	GithubUser       *APIGithubUser              `json:"github_user"`
	SlackUsername    *string                     `json:"slack_username"`
	Notifications    *APINotificationPreferences `json:"notifications"`
	SpruceFeedback   *APIFeedbackSubmission      `json:"spruce_feedback"`
}

func ApplyUserChanges

func ApplyUserChanges(current user.UserSettings, changes APIUserSettings) (APIUserSettings, error)

func (*APIUserSettings) BuildFromService

func (s *APIUserSettings) BuildFromService(h interface{}) error

func (*APIUserSettings) ToService

func (s *APIUserSettings) ToService() (interface{}, error)

type APIVSphereConfig

type APIVSphereConfig struct {
	Host     *string `json:"host"`
	Username *string `json:"username"`
	Password *string `json:"password"`
}

func (*APIVSphereConfig) BuildFromService

func (a *APIVSphereConfig) BuildFromService(h interface{}) error

func (*APIVSphereConfig) ToService

func (a *APIVSphereConfig) ToService() (interface{}, error)

type APIVersion

type APIVersion struct {
	Id            *string       `json:"version_id"`
	CreateTime    *time.Time    `json:"create_time"`
	StartTime     *time.Time    `json:"start_time"`
	FinishTime    *time.Time    `json:"finish_time"`
	Revision      *string       `json:"revision"`
	Order         int           `json:"order"`
	Project       *string       `json:"project"`
	Author        *string       `json:"author"`
	AuthorEmail   *string       `json:"author_email"`
	Message       *string       `json:"message"`
	Status        *string       `json:"status"`
	Repo          *string       `json:"repo"`
	Branch        *string       `json:"branch"`
	BuildVariants []buildDetail `json:"build_variants_status"`
	Requester     *string       `json:"requester"`
	Errors        []*string     `json:"errors"`
}

APIVersion is the model to be returned by the API whenever versions are fetched.

func (*APIVersion) BuildFromService

func (apiVersion *APIVersion) BuildFromService(h interface{}) error

BuildFromService converts from service level structs to an APIVersion.

func (*APIVersion) ToService

func (apiVersion *APIVersion) ToService() (interface{}, error)

ToService returns a service layer build using the data from the APIVersion.

type APIVersionCost

type APIVersionCost struct {
	VersionId     *string     `json:"version_id"`
	SumTimeTaken  APIDuration `json:"sum_time_taken"`
	EstimatedCost float64     `json:"estimated_cost"`
}

APIVersionCost is the model to be returned by the API whenever cost data is fetched by version id.

func (*APIVersionCost) BuildFromService

func (apiVersionCost *APIVersionCost) BuildFromService(h interface{}) error

BuildFromService converts from a service level task by loading the data into the appropriate fields of the APIVersionCost.

func (*APIVersionCost) ToService

func (apiVersionCost *APIVersionCost) ToService() (interface{}, error)

ToService returns a service layer version cost using the data from APIVersionCost.

type APIVersions

type APIVersions struct {
	// whether or not the version element actually consists of multiple inactive
	// versions rolled up into one
	RolledUp bool `json:"rolled_up"`

	Versions []APIVersion `json:"versions"`
}

type APIVolume

type APIVolume struct {
	ID               *string    `json:"volume_id"`
	DisplayName      *string    `json:"display_name"`
	CreatedBy        *string    `json:"created_by"`
	Type             *string    `json:"type"`
	AvailabilityZone *string    `json:"zone"`
	Size             int        `json:"size"`
	Expiration       *time.Time `json:"expiration"`
	DeviceName       *string    `json:"device_name"`
	HostID           *string    `json:"host_id"`
	NoExpiration     bool       `json:"no_expiration"`
	HomeVolume       bool       `json:"home_volume"`
}

func (*APIVolume) BuildFromService

func (apiVolume *APIVolume) BuildFromService(volume interface{}) error

func (*APIVolume) ToService

func (apiVolume *APIVolume) ToService() (interface{}, error)

type APIVolumeModify

type APIVolumeModify struct {
	Action     *string    `json:"action"`
	HostID     *string    `json:"host_id"`
	Expiration *time.Time `json:"expiration"`
	NewName    *string    `json:"new_name"`
}

type APIWebhookSubscriber

type APIWebhookSubscriber struct {
	URL    *string `json:"url" mapstructure:"url"`
	Secret *string `json:"secret" mapstructure:"secret"`
}

func (*APIWebhookSubscriber) BuildFromService

func (s *APIWebhookSubscriber) BuildFromService(h interface{}) error

func (*APIWebhookSubscriber) ToService

func (s *APIWebhookSubscriber) ToService() (interface{}, error)

type APIWorkstationConfig

type APIWorkstationConfig struct {
	SetupCommands []APIWorkstationSetupCommand `bson:"setup_commands" json:"setup_commands"`
	GitClone      bool                         `bson:"git_clone" json:"git_clone"`
}

func (*APIWorkstationConfig) BuildFromService

func (c *APIWorkstationConfig) BuildFromService(h interface{}) error

func (*APIWorkstationConfig) ToService

func (c *APIWorkstationConfig) ToService() (interface{}, error)

type APIWorkstationSetupCommand

type APIWorkstationSetupCommand struct {
	Command   *string `bson:"command" json:"command"`
	Directory *string `bson:"directory" json:"directory"`
}

type APIapiConfig

type APIapiConfig struct {
	HttpListenAddr      *string `json:"http_listen_addr"`
	GithubWebhookSecret *string `json:"github_webhook_secret"`
}

func (*APIapiConfig) BuildFromService

func (a *APIapiConfig) BuildFromService(h interface{}) error

func (*APIapiConfig) ToService

func (a *APIapiConfig) ToService() (interface{}, error)

type ApiTaskEndDetail

type ApiTaskEndDetail struct {
	Status      *string           `json:"status"`
	Type        *string           `json:"type"`
	Description *string           `json:"desc"`
	TimedOut    bool              `json:"timed_out"`
	OOMTracker  APIOomTrackerInfo `json:"oom_tracker_info"`
}

func (*ApiTaskEndDetail) BuildFromService

func (at *ApiTaskEndDetail) BuildFromService(t interface{}) error

func (*ApiTaskEndDetail) ToService

func (ad *ApiTaskEndDetail) ToService() (interface{}, error)

type BuildList

type BuildList struct {
	BuildVariant string              `json:"build_variant"`
	Builds       map[string]APIBuild `json:"builds"`
}

type CreateHost

type CreateHost struct {
	DNSName    *string `json:"dns_name,omitempty"`
	IP         *string `json:"ip_address,omitempty"`
	InstanceID *string `json:"instance_id,omitempty"`

	HostID       *string      `json:"host_id,omitempty"`
	ParentID     *string      `json:"parent_id,omitempty"`
	Image        *string      `json:"image,omitempty"`
	Command      *string      `json:"command,omitempty"`
	PortBindings host.PortMap `json:"port_bindings,omitempty"`
}

func (*CreateHost) BuildFromService

func (createHost *CreateHost) BuildFromService(h interface{}) error

func (*CreateHost) ToService

func (createHost *CreateHost) ToService() (interface{}, error)

type DistroInfo

type DistroInfo struct {
	Id       *string `json:"distro_id"`
	Provider *string `json:"provider"`
	ImageId  *string `json:"image_id"`
}

type FileDiff

type FileDiff struct {
	FileName  *string `json:"file_name"`
	Additions int     `json:"additions"`
	Deletions int     `json:"deletions"`
	DiffLink  *string `json:"diff_link"`
}

type HostRequestOptions

type HostRequestOptions struct {
	DistroID             string     `json:"distro" yaml:"distro"`
	TaskID               string     `json:"task" yaml:"task"`
	TaskSync             bool       `json:"task_sync" yaml:"task_sync"`
	Region               string     `json:"region" yaml:"region"`
	KeyName              string     `json:"keyname" yaml:"key"`
	UserData             string     `json:"userdata" yaml:"userdata_file"`
	Tag                  string     `yaml:"tag"`
	InstanceTags         []host.Tag `json:"instance_tags" yaml:"instance_tags"`
	InstanceType         string     `json:"instance_type" yaml:"type"`
	NoExpiration         bool       `json:"no_expiration" yaml:"no-expire"`
	IsVirtualWorkstation bool       `json:"is_virtual_workstation" yaml:"is_virtual_workstation"`
	IsCluster            bool       `json:"is_cluster" yaml:"is_cluster"`
	HomeVolumeSize       int        `json:"home_volume_size" yaml:"home_volume_size"`
	HomeVolumeID         string     `json:"home_volume_id" yaml:"home_volume_id"`
}

HostPostRequest is a struct that holds the format of a POST request to /hosts the yaml tags are used by hostCreate() when parsing the params from a file

type LogLinks struct {
	AllLogLink    *string `json:"all_log"`
	TaskLogLink   *string `json:"task_log"`
	AgentLogLink  *string `json:"agent_log"`
	SystemLogLink *string `json:"system_log"`
	EventLogLink  *string `json:"event_log"`
}

type MockEmbedded

type MockEmbedded struct {
	One MockLayerOne
}

type MockLayerOne

type MockLayerOne struct {
	Two MockLayerTwo
}

type MockLayerTwo

type MockLayerTwo struct {
	SomeField *string
}

type MockModel

type MockModel struct {
	FieldId   string
	FieldInt1 int
	FieldInt2 int
	FieldMap  map[string]string

	FieldStruct *MockSubStruct
}

func (*MockModel) BuildFromService

func (m *MockModel) BuildFromService(in interface{}) error

func (*MockModel) ToService

func (m *MockModel) ToService() (interface{}, error)

type MockScalars

type MockScalars struct {
	TimeType time.Time
	MapType  map[string]interface{}
	AnyType  interface{}
}

type MockSubStruct

type MockSubStruct struct {
	SubInt int
}

type MockTypes

type MockTypes struct {
	BoolType       bool
	BoolPtrType    *bool
	IntType        int
	IntPtrType     *int
	StringType     string
	StringPtrType  *string
	Uint64Type     uint64
	Uint64PtrType  *uint64
	Float64Type    float64
	Float64PtrType *float64
	RuneType       rune
	RunePtrType    *rune
}

type Model

type Model interface {
	BuildFromService(interface{}) error
	ToService() (interface{}, error)
}

Model defines how an API resource which will be both taken from requests and turned into service layer models and taken from service layer models and turned into api models to be returned.

func AdminDbToRestModel

func AdminDbToRestModel(in evergreen.ConfigSection) (Model, error)

type ModelMapping

type ModelMapping map[string]string

ModelMapping maps schema type names to their respective DB model

type RestartResponse

type RestartResponse struct {
	ItemsRestarted []string `json:"items_restarted"`
	ItemsErrored   []string `json:"items_errored"`
}

RestartTasksResponse is the response model returned from the /admin/restart route

func (*RestartResponse) BuildFromService

func (rtr *RestartResponse) BuildFromService(h interface{}) error

BuildFromService builds a model from the service layer

func (*RestartResponse) ToService

func (rtr *RestartResponse) ToService() (interface{}, error)

ToService is not implemented for /admin/restart

type StartAtKey

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

StartAtKey is a struct used to build the start_at key parameter for pagination.

func (StartAtKey) String

func (s StartAtKey) String() string

type TaskEventData

type TaskEventData struct {
	Execution int        `bson:"execution" json:"execution"`
	HostId    *string    `bson:"h_id,omitempty" json:"host_id,omitempty"`
	UserId    *string    `bson:"u_id,omitempty" json:"user_id,omitempty"`
	Status    *string    `bson:"s,omitempty" json:"status,omitempty"`
	JiraIssue *string    `bson:"jira,omitempty" json:"jira,omitempty"`
	JiraLink  *string    `bson:"jira_link,omitempty" json:"jira_link,omitempty"`
	Timestamp *time.Time `bson:"ts,omitempty" json:"timestamp,omitempty"`
	Priority  int64      `bson:"pri,omitempty" json:"priority,omitempty"`
}

func (*TaskEventData) BuildFromService

func (el *TaskEventData) BuildFromService(v *event.TaskEventData)

func (*TaskEventData) ToService

func (el *TaskEventData) ToService() (interface{}, error)

ToService is not implemented for TaskEventData.

type TestLogs

type TestLogs struct {
	URL            *string `json:"url"`
	LineNum        int     `json:"line_num"`
	URLRaw         *string `json:"url_raw"`
	LogId          *string `json:"log_id"`
	RawDisplayURL  *string `json:"url_raw_display"`
	HTMLDisplayURL *string `json:"url_html_display"`
}

TestLogs is a struct for storing the information about logs that will be written out as part of an APITest.

type UIProjectFields

type UIProjectFields struct {
	Identifier  string `json:"identifier"`
	DisplayName string `json:"display_name"`
	Repo        string `json:"repo_name"`
	Owner       string `json:"owner_name"`
}

publicProjectFields are the fields needed by the UI on base_angular and the menu

type VariantTask

type VariantTask struct {
	Name  *string   `json:"name"`
	Tasks []*string `json:"tasks"`
}

type VersionVariantData

type VersionVariantData struct {
	Rows          map[string]BuildList `json:"rows"`
	Versions      []APIVersions        `json:"versions"`
	BuildVariants []string             `json:"build_variants"`
}

func (*VersionVariantData) BuildFromService

func (v *VersionVariantData) BuildFromService(h interface{}) error

func (*VersionVariantData) ToService

func (v *VersionVariantData) ToService() (interface{}, error)

type VolumeModifyOptions

type VolumeModifyOptions struct {
	NewName       string    `json:"new_name"`
	Size          int       `json:"size"`
	Expiration    time.Time `json:"expiration"`
	NoExpiration  bool      `json:"no_expiration"`
	HasExpiration bool      `json:"has_expiration"`
}

type VolumePostRequest

type VolumePostRequest struct {
	Type             string `json:"type"`
	Size             int    `json:"size"`
	AvailabilityZone string `json:"zone"`
}

Jump to

Keyboard shortcuts

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