arvados

package
v0.0.0-...-52d6522 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0, Apache-2.0, CC-BY-SA-3.0 Imports: 40 Imported by: 1

Documentation

Overview

Package arvados is a client library for Arvados.

The API is not stable: it should be considered experimental pre-release.

The intent is to offer model types and API call functions that can be generated automatically (or at least mostly automatically) from a discovery document. For the time being, there is a manually generated subset of those types and API calls with (approximately) the right signatures, plus client/authentication support and some convenience functions.

Index

Constants

View Source
const (
	ContainerStateQueued    = ContainerState("Queued")
	ContainerStateLocked    = ContainerState("Locked")
	ContainerStateRunning   = ContainerState("Running")
	ContainerStateComplete  = ContainerState("Complete")
	ContainerStateCancelled = ContainerState("Cancelled")
)
View Source
const (
	ContainerRequestStateUncomitted = ContainerRequestState("Uncommitted")
	ContainerRequestStateCommitted  = ContainerRequestState("Committed")
	ContainerRequestStateFinal      = ContainerRequestState("Final")
)

Variables

View Source
var (
	EndpointConfigGet                       = APIEndpoint{"GET", "arvados/v1/config", ""}
	EndpointVocabularyGet                   = APIEndpoint{"GET", "arvados/v1/vocabulary", ""}
	EndpointDiscoveryDocument               = APIEndpoint{"GET", "discovery/v1/apis/arvados/v1/rest", ""}
	EndpointLogin                           = APIEndpoint{"GET", "login", ""}
	EndpointLogout                          = APIEndpoint{"GET", "logout", ""}
	EndpointAuthorizedKeyCreate             = APIEndpoint{"POST", "arvados/v1/authorized_keys", "authorized_key"}
	EndpointAuthorizedKeyUpdate             = APIEndpoint{"PATCH", "arvados/v1/authorized_keys/{uuid}", "authorized_key"}
	EndpointAuthorizedKeyGet                = APIEndpoint{"GET", "arvados/v1/authorized_keys/{uuid}", ""}
	EndpointAuthorizedKeyList               = APIEndpoint{"GET", "arvados/v1/authorized_keys", ""}
	EndpointAuthorizedKeyDelete             = APIEndpoint{"DELETE", "arvados/v1/authorized_keys/{uuid}", ""}
	EndpointCollectionCreate                = APIEndpoint{"POST", "arvados/v1/collections", "collection"}
	EndpointCollectionUpdate                = APIEndpoint{"PATCH", "arvados/v1/collections/{uuid}", "collection"}
	EndpointCollectionGet                   = APIEndpoint{"GET", "arvados/v1/collections/{uuid}", ""}
	EndpointCollectionList                  = APIEndpoint{"GET", "arvados/v1/collections", ""}
	EndpointCollectionProvenance            = APIEndpoint{"GET", "arvados/v1/collections/{uuid}/provenance", ""}
	EndpointCollectionUsedBy                = APIEndpoint{"GET", "arvados/v1/collections/{uuid}/used_by", ""}
	EndpointCollectionDelete                = APIEndpoint{"DELETE", "arvados/v1/collections/{uuid}", ""}
	EndpointCollectionTrash                 = APIEndpoint{"POST", "arvados/v1/collections/{uuid}/trash", ""}
	EndpointCollectionUntrash               = APIEndpoint{"POST", "arvados/v1/collections/{uuid}/untrash", ""}
	EndpointSpecimenCreate                  = APIEndpoint{"POST", "arvados/v1/specimens", "specimen"}
	EndpointSpecimenUpdate                  = APIEndpoint{"PATCH", "arvados/v1/specimens/{uuid}", "specimen"}
	EndpointSpecimenGet                     = APIEndpoint{"GET", "arvados/v1/specimens/{uuid}", ""}
	EndpointSpecimenList                    = APIEndpoint{"GET", "arvados/v1/specimens", ""}
	EndpointSpecimenDelete                  = APIEndpoint{"DELETE", "arvados/v1/specimens/{uuid}", ""}
	EndpointContainerCreate                 = APIEndpoint{"POST", "arvados/v1/containers", "container"}
	EndpointContainerUpdate                 = APIEndpoint{"PATCH", "arvados/v1/containers/{uuid}", "container"}
	EndpointContainerPriorityUpdate         = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/update_priority", "container"}
	EndpointContainerGet                    = APIEndpoint{"GET", "arvados/v1/containers/{uuid}", ""}
	EndpointContainerList                   = APIEndpoint{"GET", "arvados/v1/containers", ""}
	EndpointContainerDelete                 = APIEndpoint{"DELETE", "arvados/v1/containers/{uuid}", ""}
	EndpointContainerLock                   = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/lock", ""}
	EndpointContainerUnlock                 = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/unlock", ""}
	EndpointContainerSSH                    = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/ssh", ""}
	EndpointContainerSSHCompat              = APIEndpoint{"POST", "arvados/v1/connect/{uuid}/ssh", ""} // for compatibility with arvados <2.7
	EndpointContainerGatewayTunnel          = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/gateway_tunnel", ""}
	EndpointContainerGatewayTunnelCompat    = APIEndpoint{"POST", "arvados/v1/connect/{uuid}/gateway_tunnel", ""} // for compatibility with arvados <2.7
	EndpointContainerRequestCreate          = APIEndpoint{"POST", "arvados/v1/container_requests", "container_request"}
	EndpointContainerRequestUpdate          = APIEndpoint{"PATCH", "arvados/v1/container_requests/{uuid}", "container_request"}
	EndpointContainerRequestGet             = APIEndpoint{"GET", "arvados/v1/container_requests/{uuid}", ""}
	EndpointContainerRequestList            = APIEndpoint{"GET", "arvados/v1/container_requests", ""}
	EndpointContainerRequestDelete          = APIEndpoint{"DELETE", "arvados/v1/container_requests/{uuid}", ""}
	EndpointContainerRequestContainerStatus = APIEndpoint{"GET", "arvados/v1/container_requests/{uuid}/container_status", ""}
	EndpointContainerRequestLog             = APIEndpoint{"GET", "arvados/v1/container_requests/{uuid}/log{path:|/.*}", ""}
	EndpointGroupCreate                     = APIEndpoint{"POST", "arvados/v1/groups", "group"}
	EndpointGroupUpdate                     = APIEndpoint{"PATCH", "arvados/v1/groups/{uuid}", "group"}
	EndpointGroupGet                        = APIEndpoint{"GET", "arvados/v1/groups/{uuid}", ""}
	EndpointGroupList                       = APIEndpoint{"GET", "arvados/v1/groups", ""}
	EndpointGroupContents                   = APIEndpoint{"GET", "arvados/v1/groups/contents", ""}
	EndpointGroupContentsUUIDInPath         = APIEndpoint{"GET", "arvados/v1/groups/{uuid}/contents", ""} // Alternative HTTP route; client-side code should always use EndpointGroupContents instead
	EndpointGroupShared                     = APIEndpoint{"GET", "arvados/v1/groups/shared", ""}
	EndpointGroupDelete                     = APIEndpoint{"DELETE", "arvados/v1/groups/{uuid}", ""}
	EndpointGroupTrash                      = APIEndpoint{"POST", "arvados/v1/groups/{uuid}/trash", ""}
	EndpointGroupUntrash                    = APIEndpoint{"POST", "arvados/v1/groups/{uuid}/untrash", ""}
	EndpointLinkCreate                      = APIEndpoint{"POST", "arvados/v1/links", "link"}
	EndpointLinkUpdate                      = APIEndpoint{"PATCH", "arvados/v1/links/{uuid}", "link"}
	EndpointLinkGet                         = APIEndpoint{"GET", "arvados/v1/links/{uuid}", ""}
	EndpointLinkList                        = APIEndpoint{"GET", "arvados/v1/links", ""}
	EndpointLinkDelete                      = APIEndpoint{"DELETE", "arvados/v1/links/{uuid}", ""}
	EndpointLogCreate                       = APIEndpoint{"POST", "arvados/v1/logs", "log"}
	EndpointLogUpdate                       = APIEndpoint{"PATCH", "arvados/v1/logs/{uuid}", "log"}
	EndpointLogGet                          = APIEndpoint{"GET", "arvados/v1/logs/{uuid}", ""}
	EndpointLogList                         = APIEndpoint{"GET", "arvados/v1/logs", ""}
	EndpointLogDelete                       = APIEndpoint{"DELETE", "arvados/v1/logs/{uuid}", ""}
	EndpointSysTrashSweep                   = APIEndpoint{"POST", "sys/trash_sweep", ""}
	EndpointUserActivate                    = APIEndpoint{"POST", "arvados/v1/users/{uuid}/activate", ""}
	EndpointUserCreate                      = APIEndpoint{"POST", "arvados/v1/users", "user"}
	EndpointUserCurrent                     = APIEndpoint{"GET", "arvados/v1/users/current", ""}
	EndpointUserDelete                      = APIEndpoint{"DELETE", "arvados/v1/users/{uuid}", ""}
	EndpointUserGet                         = APIEndpoint{"GET", "arvados/v1/users/{uuid}", ""}
	EndpointUserGetCurrent                  = APIEndpoint{"GET", "arvados/v1/users/current", ""}
	EndpointUserGetSystem                   = APIEndpoint{"GET", "arvados/v1/users/system", ""}
	EndpointUserList                        = APIEndpoint{"GET", "arvados/v1/users", ""}
	EndpointUserMerge                       = APIEndpoint{"POST", "arvados/v1/users/merge", ""}
	EndpointUserSetup                       = APIEndpoint{"POST", "arvados/v1/users/setup", "user"}
	EndpointUserSystem                      = APIEndpoint{"GET", "arvados/v1/users/system", ""}
	EndpointUserUnsetup                     = APIEndpoint{"POST", "arvados/v1/users/{uuid}/unsetup", ""}
	EndpointUserUpdate                      = APIEndpoint{"PATCH", "arvados/v1/users/{uuid}", "user"}
	EndpointUserBatchUpdate                 = APIEndpoint{"PATCH", "arvados/v1/users/batch_update", ""}
	EndpointUserAuthenticate                = APIEndpoint{"POST", "arvados/v1/users/authenticate", ""}
	EndpointAPIClientAuthorizationCurrent   = APIEndpoint{"GET", "arvados/v1/api_client_authorizations/current", ""}
	EndpointAPIClientAuthorizationCreate    = APIEndpoint{"POST", "arvados/v1/api_client_authorizations", "api_client_authorization"}
	EndpointAPIClientAuthorizationUpdate    = APIEndpoint{"PUT", "arvados/v1/api_client_authorizations/{uuid}", "api_client_authorization"}
	EndpointAPIClientAuthorizationList      = APIEndpoint{"GET", "arvados/v1/api_client_authorizations", ""}
	EndpointAPIClientAuthorizationDelete    = APIEndpoint{"DELETE", "arvados/v1/api_client_authorizations/{uuid}", ""}
	EndpointAPIClientAuthorizationGet       = APIEndpoint{"GET", "arvados/v1/api_client_authorizations/{uuid}", ""}
)
View Source
var (
	// ErrSignatureExpired - a signature was rejected because the
	// expiry time has passed.
	ErrSignatureExpired = errors.New("Signature expired")
	// ErrSignatureInvalid - a signature was rejected because it
	// was badly formatted or did not match the given secret key.
	ErrSignatureInvalid = errors.New("Invalid signature")
	// ErrSignatureMissing - the given locator does not have a
	// signature hint.
	ErrSignatureMissing = errors.New("Missing signature")
)
View Source
var (
	UUIDMatch = regexp.MustCompile(`^[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}$`).MatchString
	PDHMatch  = regexp.MustCompile(`^[0-9a-f]{32}\+\d+$`).MatchString
)
View Source
var (
	ErrReadOnlyFile      = errors.New("read-only file")
	ErrNegativeOffset    = errors.New("cannot seek to negative offset")
	ErrFileExists        = errors.New("file exists")
	ErrInvalidOperation  = errors.New("invalid operation")
	ErrInvalidArgument   = errors.New("invalid argument")
	ErrDirectoryNotEmpty = errors.New("directory not empty")
	ErrWriteOnlyMode     = errors.New("file is O_WRONLY")
	ErrSyncNotSupported  = errors.New("O_SYNC flag is not supported")
	ErrIsDirectory       = errors.New("cannot rename file to overwrite existing directory")
	ErrNotADirectory     = errors.New("not a directory")
	ErrPermission        = os.ErrPermission
	DebugLocksPanicMode  = false
)
View Source
var DefaultConfigFile = func() string {
	if path := os.Getenv("ARVADOS_CONFIG"); path != "" {
		return path
	}
	return "/etc/arvados/config.yml"
}()
View Source
var DefaultSecureClient = &http.Client{}

DefaultSecureClient is the default http.Client used by a Client otherwise.

View Source
var InsecureHTTPClient = &http.Client{
	Transport: &http.Transport{
		TLSClientConfig: &tls.Config{
			InsecureSkipVerify: true}}}

InsecureHTTPClient is the default http.Client used by a Client with Insecure==true and Client==nil.

View Source
var SignedLocatorRe = regexp.MustCompile(

	`^([[:xdigit:]]{32})(\+[0-9]+)?((\+[B-Z][A-Za-z0-9@_-]*)*)(\+A([[:xdigit:]]{40})@([[:xdigit:]]{8}))((\+[B-Z][A-Za-z0-9@_-]*)*)$`)

Functions

func CollectionIDFromDNSName

func CollectionIDFromDNSName(s string) string

CollectionIDFromDNSName returns a UUID or PDH if s begins with a UUID or URL-encoded PDH; otherwise "".

func ContextWithAuthorization

func ContextWithAuthorization(ctx context.Context, value string) context.Context

ContextWithAuthorization returns a child context that (when used with (*Client)RequestAndDecodeContext) sends the given Authorization header value instead of the Client's default AuthToken.

func ContextWithRequestID

func ContextWithRequestID(ctx context.Context, reqid string) context.Context

func FS

func FS(fs FileSystem) fs.FS

FS returns an fs.FS interface to the given FileSystem, to enable the use of fs.WalkDir, etc.

func PortableDataHash

func PortableDataHash(mt string) string

PortableDataHash computes the portable data hash of the given manifest.

func RandomUUID

func RandomUUID(clusterID, infix string) string

func SignLocator

func SignLocator(blobLocator, apiToken string, expiry time.Time, blobSignatureTTL time.Duration, permissionSecret []byte) string

SignLocator returns blobLocator with a permission signature added. If either permissionSecret or apiToken is empty, blobLocator is returned untouched.

This function is intended to be used by system components and admin utilities: userland programs do not know the permissionSecret.

func SignManifest

func SignManifest(manifest string, apiToken string, expiry time.Time, ttl time.Duration, permissionSecret []byte) string

SignManifest signs all locators in the given manifest, discarding any existing signatures.

func Splice

func Splice(fs FileSystem, target string, newsubtree *Subtree) error

Splice inserts newsubtree at the indicated target path.

Splice returns an error if target is not inside a collection.

Splice returns an error if target is the root of a collection and newsubtree is a snapshot of a file.

func VerifySignature

func VerifySignature(signedLocator, apiToken string, blobSignatureTTL time.Duration, permissionSecret []byte) error

VerifySignature returns nil if the signature on the signedLocator can be verified using the given apiToken. Otherwise it returns ErrSignatureExpired (if the signature's expiry time has passed, which is something the client could have figured out independently), ErrSignatureMissing (if there is no signature hint at all), or ErrSignatureInvalid (if the signature is present but badly formatted or incorrect).

This function is intended to be used by system components and admin utilities: userland programs do not know the permissionSecret.

Types

type API

type API interface {
	ConfigGet(ctx context.Context) (json.RawMessage, error)
	VocabularyGet(ctx context.Context) (Vocabulary, error)
	Login(ctx context.Context, options LoginOptions) (LoginResponse, error)
	Logout(ctx context.Context, options LogoutOptions) (LogoutResponse, error)
	AuthorizedKeyCreate(ctx context.Context, options CreateOptions) (AuthorizedKey, error)
	AuthorizedKeyUpdate(ctx context.Context, options UpdateOptions) (AuthorizedKey, error)
	AuthorizedKeyGet(ctx context.Context, options GetOptions) (AuthorizedKey, error)
	AuthorizedKeyList(ctx context.Context, options ListOptions) (AuthorizedKeyList, error)
	AuthorizedKeyDelete(ctx context.Context, options DeleteOptions) (AuthorizedKey, error)
	CollectionCreate(ctx context.Context, options CreateOptions) (Collection, error)
	CollectionUpdate(ctx context.Context, options UpdateOptions) (Collection, error)
	CollectionGet(ctx context.Context, options GetOptions) (Collection, error)
	CollectionList(ctx context.Context, options ListOptions) (CollectionList, error)
	CollectionProvenance(ctx context.Context, options GetOptions) (map[string]interface{}, error)
	CollectionUsedBy(ctx context.Context, options GetOptions) (map[string]interface{}, error)
	CollectionDelete(ctx context.Context, options DeleteOptions) (Collection, error)
	CollectionTrash(ctx context.Context, options DeleteOptions) (Collection, error)
	CollectionUntrash(ctx context.Context, options UntrashOptions) (Collection, error)
	ContainerCreate(ctx context.Context, options CreateOptions) (Container, error)
	ContainerUpdate(ctx context.Context, options UpdateOptions) (Container, error)
	ContainerPriorityUpdate(ctx context.Context, options UpdateOptions) (Container, error)
	ContainerGet(ctx context.Context, options GetOptions) (Container, error)
	ContainerList(ctx context.Context, options ListOptions) (ContainerList, error)
	ContainerDelete(ctx context.Context, options DeleteOptions) (Container, error)
	ContainerLock(ctx context.Context, options GetOptions) (Container, error)
	ContainerUnlock(ctx context.Context, options GetOptions) (Container, error)
	ContainerSSH(ctx context.Context, options ContainerSSHOptions) (ConnectionResponse, error)
	ContainerGatewayTunnel(ctx context.Context, options ContainerGatewayTunnelOptions) (ConnectionResponse, error)
	ContainerRequestCreate(ctx context.Context, options CreateOptions) (ContainerRequest, error)
	ContainerRequestUpdate(ctx context.Context, options UpdateOptions) (ContainerRequest, error)
	ContainerRequestGet(ctx context.Context, options GetOptions) (ContainerRequest, error)
	ContainerRequestList(ctx context.Context, options ListOptions) (ContainerRequestList, error)
	ContainerRequestDelete(ctx context.Context, options DeleteOptions) (ContainerRequest, error)
	ContainerRequestContainerStatus(ctx context.Context, options GetOptions) (ContainerStatus, error)
	ContainerRequestLog(ctx context.Context, options ContainerLogOptions) (http.Handler, error)
	GroupCreate(ctx context.Context, options CreateOptions) (Group, error)
	GroupUpdate(ctx context.Context, options UpdateOptions) (Group, error)
	GroupGet(ctx context.Context, options GetOptions) (Group, error)
	GroupList(ctx context.Context, options ListOptions) (GroupList, error)
	GroupContents(ctx context.Context, options GroupContentsOptions) (ObjectList, error)
	GroupShared(ctx context.Context, options ListOptions) (GroupList, error)
	GroupDelete(ctx context.Context, options DeleteOptions) (Group, error)
	GroupTrash(ctx context.Context, options DeleteOptions) (Group, error)
	GroupUntrash(ctx context.Context, options UntrashOptions) (Group, error)
	LinkCreate(ctx context.Context, options CreateOptions) (Link, error)
	LinkUpdate(ctx context.Context, options UpdateOptions) (Link, error)
	LinkGet(ctx context.Context, options GetOptions) (Link, error)
	LinkList(ctx context.Context, options ListOptions) (LinkList, error)
	LinkDelete(ctx context.Context, options DeleteOptions) (Link, error)
	LogCreate(ctx context.Context, options CreateOptions) (Log, error)
	LogUpdate(ctx context.Context, options UpdateOptions) (Log, error)
	LogGet(ctx context.Context, options GetOptions) (Log, error)
	LogList(ctx context.Context, options ListOptions) (LogList, error)
	LogDelete(ctx context.Context, options DeleteOptions) (Log, error)
	SpecimenCreate(ctx context.Context, options CreateOptions) (Specimen, error)
	SpecimenUpdate(ctx context.Context, options UpdateOptions) (Specimen, error)
	SpecimenGet(ctx context.Context, options GetOptions) (Specimen, error)
	SpecimenList(ctx context.Context, options ListOptions) (SpecimenList, error)
	SpecimenDelete(ctx context.Context, options DeleteOptions) (Specimen, error)
	SysTrashSweep(ctx context.Context, options struct{}) (struct{}, error)
	UserCreate(ctx context.Context, options CreateOptions) (User, error)
	UserUpdate(ctx context.Context, options UpdateOptions) (User, error)
	UserMerge(ctx context.Context, options UserMergeOptions) (User, error)
	UserActivate(ctx context.Context, options UserActivateOptions) (User, error)
	UserSetup(ctx context.Context, options UserSetupOptions) (map[string]interface{}, error)
	UserUnsetup(ctx context.Context, options GetOptions) (User, error)
	UserGet(ctx context.Context, options GetOptions) (User, error)
	UserGetCurrent(ctx context.Context, options GetOptions) (User, error)
	UserGetSystem(ctx context.Context, options GetOptions) (User, error)
	UserList(ctx context.Context, options ListOptions) (UserList, error)
	UserDelete(ctx context.Context, options DeleteOptions) (User, error)
	UserBatchUpdate(context.Context, UserBatchUpdateOptions) (UserList, error)
	UserAuthenticate(ctx context.Context, options UserAuthenticateOptions) (APIClientAuthorization, error)
	APIClientAuthorizationCurrent(ctx context.Context, options GetOptions) (APIClientAuthorization, error)
	APIClientAuthorizationCreate(ctx context.Context, options CreateOptions) (APIClientAuthorization, error)
	APIClientAuthorizationList(ctx context.Context, options ListOptions) (APIClientAuthorizationList, error)
	APIClientAuthorizationDelete(ctx context.Context, options DeleteOptions) (APIClientAuthorization, error)
	APIClientAuthorizationUpdate(ctx context.Context, options UpdateOptions) (APIClientAuthorization, error)
	APIClientAuthorizationGet(ctx context.Context, options GetOptions) (APIClientAuthorization, error)
	DiscoveryDocument(ctx context.Context) (DiscoveryDocument, error)
}

type APIClientAuthorization

type APIClientAuthorization struct {
	UUID                 string    `json:"uuid"`
	APIClientID          int       `json:"api_client_id"`
	APIToken             string    `json:"api_token"`
	CreatedAt            time.Time `json:"created_at"`
	CreatedByIPAddress   string    `json:"created_by_ip_address"`
	DefaultOwnerUUID     string    `json:"default_owner_uuid"`
	Etag                 string    `json:"etag"`
	ExpiresAt            time.Time `json:"expires_at"`
	LastUsedAt           time.Time `json:"last_used_at"`
	LastUsedByIPAddress  string    `json:"last_used_by_ip_address"`
	ModifiedAt           time.Time `json:"modified_at"`
	ModifiedByClientUUID string    `json:"modified_by_client_uuid"`
	ModifiedByUserUUID   string    `json:"modified_by_user_uuid"`
	OwnerUUID            string    `json:"owner_uuid"`
	Scopes               []string  `json:"scopes"`
	UserID               int       `json:"user_id"`
}

APIClientAuthorization is an arvados#apiClientAuthorization resource.

func (APIClientAuthorization) TokenV2

func (aca APIClientAuthorization) TokenV2() string

type APIClientAuthorizationList

type APIClientAuthorizationList struct {
	Items []APIClientAuthorization `json:"items"`
}

APIClientAuthorizationList is an arvados#apiClientAuthorizationList resource.

type APIEndpoint

type APIEndpoint struct {
	Method string
	Path   string
	// "new attributes" key for create/update requests
	AttrsKey string
}

type AuthorizedKey

type AuthorizedKey struct {
	UUID                 string    `json:"uuid"`
	Etag                 string    `json:"etag"`
	OwnerUUID            string    `json:"owner_uuid"`
	CreatedAt            time.Time `json:"created_at"`
	ModifiedAt           time.Time `json:"modified_at"`
	ModifiedByClientUUID string    `json:"modified_by_client_uuid"`
	ModifiedByUserUUID   string    `json:"modified_by_user_uuid"`
	Name                 string    `json:"name"`
	AuthorizedUserUUID   string    `json:"authorized_user_uuid"`
	PublicKey            string    `json:"public_key"`
	KeyType              string    `json:"key_type"`
	ExpiresAt            time.Time `json:"expires_at"`
}

AuthorizedKey is an arvados#authorizedKey resource.

type AuthorizedKeyList

type AuthorizedKeyList struct {
	Items          []AuthorizedKey `json:"items"`
	ItemsAvailable int             `json:"items_available"`
	Offset         int             `json:"offset"`
	Limit          int             `json:"limit"`
}

AuthorizedKeyList is an arvados#authorizedKeyList resource.

type AzureVolumeDriverParameters

type AzureVolumeDriverParameters struct {
	StorageAccountName   string
	StorageAccountKey    string
	StorageBaseURL       string
	ContainerName        string
	RequestTimeout       Duration
	ListBlobsRetryDelay  Duration
	ListBlobsMaxAttempts int
}

type BlockReadOptions

type BlockReadOptions struct {
	Locator      string
	WriteTo      io.Writer
	LocalLocator func(string)
}

type BlockWriteOptions

type BlockWriteOptions struct {
	Hash           string
	Data           []byte
	Reader         io.Reader // Must be set if Data is nil.
	DataSize       int       // Must be set if Data is nil.
	RequestID      string
	StorageClasses []string
	Replicas       int
	Attempts       int
}

type BlockWriteResponse

type BlockWriteResponse struct {
	Locator        string
	Replicas       int
	StorageClasses map[string]int
}

type ByteSize

type ByteSize int64

func (*ByteSize) UnmarshalJSON

func (n *ByteSize) UnmarshalJSON(data []byte) error

type ByteSizeOrPercent

type ByteSizeOrPercent ByteSize

ByteSizeOrPercent indicates either a number of bytes or a percentage from 1 to 100.

func (ByteSizeOrPercent) ByteSize

func (n ByteSizeOrPercent) ByteSize() ByteSize

ByteSize returns the absolute byte size specified by n, or 0 if n specifies a percent.

func (ByteSizeOrPercent) MarshalJSON

func (n ByteSizeOrPercent) MarshalJSON() ([]byte, error)

func (ByteSizeOrPercent) Percent

func (n ByteSizeOrPercent) Percent() int64

ByteSize returns the percentage specified by n, or 0 if n specifies an absolute byte size.

func (*ByteSizeOrPercent) UnmarshalJSON

func (n *ByteSizeOrPercent) UnmarshalJSON(data []byte) error

type CUDAFeatures

type CUDAFeatures struct {
	DriverVersion      string
	HardwareCapability string
	DeviceCount        int
}

type CUDARuntimeConstraints

type CUDARuntimeConstraints struct {
	DriverVersion      string `json:"driver_version"`
	HardwareCapability string `json:"hardware_capability"`
	DeviceCount        int    `json:"device_count"`
}

type Client

type Client struct {
	// HTTP client used to make requests. If nil,
	// DefaultSecureClient or InsecureHTTPClient will be used.
	Client *http.Client `json:"-"`

	// Protocol scheme: "http", "https", or "" (https)
	Scheme string

	// Hostname (or host:port) of Arvados API server.
	APIHost string

	// User authentication token.
	AuthToken string

	// Accept unverified certificates. This works only if the
	// Client field is nil: otherwise, it has no effect.
	Insecure bool

	// Override keep service discovery with a list of base
	// URIs. (Currently there are no Client methods for
	// discovering keep services so this is just a convenience for
	// callers who use a Client to initialize an
	// arvadosclient.ArvadosClient.)
	KeepServiceURIs []string `json:",omitempty"`

	// HTTP headers to add/override in outgoing requests.
	SendHeader http.Header

	// Timeout for requests. NewClientFromConfig and
	// NewClientFromEnv return a Client with a default 5 minute
	// timeout. Within this time, retryable errors are
	// automatically retried with exponential backoff.
	//
	// To disable automatic retries, set Timeout to zero and use a
	// context deadline to establish a maximum request time.
	Timeout time.Duration

	// Maximum disk cache size in bytes or percent of total
	// filesystem size. If zero, use default, currently 10% of
	// filesystem size.
	DiskCacheSize ByteSizeOrPercent
	// contains filtered or unexported fields
}

A Client is an HTTP client with an API endpoint and a set of Arvados credentials.

It offers methods for accessing individual Arvados APIs, and methods that implement common patterns like fetching multiple pages of results using List APIs.

func NewClientFromConfig

func NewClientFromConfig(cluster *Cluster) (*Client, error)

NewClientFromConfig creates a new Client that uses the endpoints in the given cluster.

AuthToken is left empty for the caller to populate.

func NewClientFromEnv

func NewClientFromEnv() *Client

NewClientFromEnv creates a new Client that uses the default HTTP client, and loads API endpoint and credentials from ARVADOS_* environment variables (if set) and $HOME/.config/arvados/settings.conf (if readable).

If a config exists in both locations, the environment variable is used.

If there is an error (other than ENOENT) reading settings.conf, NewClientFromEnv logs the error to log.Default(), then proceeds as if settings.conf did not exist.

Space characters are trimmed when reading the settings file, so these are equivalent:

ARVADOS_API_HOST=localhost\n
ARVADOS_API_HOST=localhost\r\n
ARVADOS_API_HOST = localhost \n
\tARVADOS_API_HOST = localhost\n

func (*Client) CurrentUser

func (c *Client) CurrentUser() (User, error)

CurrentUser calls arvados.v1.users.current, and returns the User record corresponding to this client's credentials.

func (*Client) CustomFileSystem

func (c *Client) CustomFileSystem(kc keepClient) CustomFileSystem

func (*Client) DiscoveryDocument

func (c *Client) DiscoveryDocument() (*DiscoveryDocument, error)

DiscoveryDocument returns a *DiscoveryDocument. The returned object should not be modified: the same object may be returned by subsequent calls.

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do augments (*http.Client)Do(): adds Authorization and X-Request-Id headers, delays in order to comply with rate-limiting restrictions, and retries failed requests when appropriate.

func (*Client) DoAndDecode

func (c *Client) DoAndDecode(dst interface{}, req *http.Request) error

DoAndDecode performs req and unmarshals the response (which must be JSON) into dst. Use this instead of RequestAndDecode if you need more control of the http.Request object.

If the response status indicates an HTTP redirect, the Location header value is unmarshalled to dst as a RedirectLocation key/field.

func (*Client) EachKeepService

func (c *Client) EachKeepService(f func(KeepService) error) error

EachKeepService calls f once for every readable KeepService. EachKeepService stops if it encounters an error, such as f returning a non-nil error.

func (*Client) KindForUUID

func (c *Client) KindForUUID(uuid string) (string, error)

func (*Client) Last503

func (c *Client) Last503() time.Time

Last503 returns the time of the most recent HTTP 503 (Service Unavailable) response. Zero time indicates never.

func (*Client) PathForUUID

func (c *Client) PathForUUID(method, uuid string) (string, error)

func (*Client) RequestAndDecode

func (c *Client) RequestAndDecode(dst interface{}, method, path string, body io.Reader, params interface{}) error

RequestAndDecode performs an API request and unmarshals the response (which must be JSON) into dst. Method and body arguments are the same as for http.NewRequest(). The given path is added to the server's scheme/host/port to form the request URL. The given params are passed via POST form or query string.

path must not contain a query string.

func (*Client) RequestAndDecodeContext

func (c *Client) RequestAndDecodeContext(ctx context.Context, dst interface{}, method, path string, body io.Reader, params interface{}) error

RequestAndDecodeContext does the same as RequestAndDecode, but with a context

func (*Client) SiteFileSystem

func (c *Client) SiteFileSystem(kc keepClient) CustomFileSystem

SiteFileSystem returns a FileSystem that maps collections and other Arvados objects onto a filesystem layout.

This is experimental: the filesystem layout is not stable, and there are significant known bugs and shortcomings. For example, writes are not persisted until Sync() is called.

func (*Client) UpdateBody

func (c *Client) UpdateBody(rsc resource) io.Reader

UpdateBody returns an io.Reader suitable for use as an http.Request Body for a create or update API call.

func (*Client) WithRequestID

func (c *Client) WithRequestID(reqid string) *Client

WithRequestID returns a new shallow copy of c that sends the given X-Request-Id value (instead of a new randomly generated one) with each subsequent request that doesn't provide its own via context or header.

type CloudVMsConfig

type CloudVMsConfig struct {
	Enable bool

	BootProbeCommand               string
	InstanceInitCommand            string
	DeployRunnerBinary             string
	DeployPublicKey                bool
	ImageID                        string
	MaxCloudOpsPerSecond           int
	MaxProbesPerSecond             int
	MaxConcurrentInstanceCreateOps int
	MaxInstances                   int
	InitialQuotaEstimate           int
	SupervisorFraction             float64
	PollInterval                   Duration
	ProbeInterval                  Duration
	SSHPort                        string
	SyncInterval                   Duration
	TimeoutBooting                 Duration
	TimeoutIdle                    Duration
	TimeoutProbe                   Duration
	TimeoutShutdown                Duration
	TimeoutSignal                  Duration
	TimeoutStaleRunLock            Duration
	TimeoutTERM                    Duration
	ResourceTags                   map[string]string
	TagKeyPrefix                   string

	Driver           string
	DriverParameters json.RawMessage
}

type Cluster

type Cluster struct {
	ClusterID       string `json:"-"`
	ManagementToken string
	SystemRootToken string
	Services        Services
	InstanceTypes   InstanceTypeMap
	Containers      ContainersConfig
	RemoteClusters  map[string]RemoteCluster
	PostgreSQL      PostgreSQL

	API struct {
		AsyncPermissionsUpdateInterval   Duration
		DisabledAPIs                     StringSet
		MaxIndexDatabaseRead             int
		MaxItemsPerResponse              int
		MaxConcurrentRailsRequests       int
		MaxConcurrentRequests            int
		MaxQueuedRequests                int
		MaxGatewayTunnels                int
		MaxQueueTimeForLockRequests      Duration
		LogCreateRequestFraction         float64
		MaxKeepBlobBuffers               int
		MaxRequestAmplification          int
		MaxRequestSize                   int
		MaxTokenLifetime                 Duration
		RequestTimeout                   Duration
		SendTimeout                      Duration
		WebsocketClientEventQueue        int
		WebsocketServerEventQueue        int
		KeepServiceRequestTimeout        Duration
		VocabularyPath                   string
		FreezeProjectRequiresDescription bool
		FreezeProjectRequiresProperties  StringSet
		UnfreezeProjectRequiresAdmin     bool
		LockBeforeUpdate                 bool
	}
	AuditLogs struct {
		MaxAge             Duration
		MaxDeleteBatch     int
		UnloggedAttributes StringSet
	}
	Collections struct {
		BlobSigning                  bool
		BlobSigningKey               string
		BlobSigningTTL               Duration
		BlobTrash                    bool
		BlobTrashLifetime            Duration
		BlobTrashCheckInterval       Duration
		BlobTrashConcurrency         int
		BlobDeleteConcurrency        int
		BlobReplicateConcurrency     int
		CollectionVersioning         bool
		DefaultTrashLifetime         Duration
		DefaultReplication           int
		ManagedProperties            ManagedProperties
		PreserveVersionIfIdle        Duration
		TrashSweepInterval           Duration
		TrustAllContent              bool
		ForwardSlashNameSubstitution string
		S3FolderObjects              bool

		BlobMissingReport        string
		BalancePeriod            Duration
		BalanceCollectionBatch   int
		BalanceCollectionBuffers int
		BalanceTimeout           Duration
		BalanceUpdateLimit       int
		BalancePullLimit         int
		BalanceTrashLimit        int

		WebDAVCache WebDAVCacheConfig

		KeepproxyPermission UploadDownloadRolePermissions
		WebDAVPermission    UploadDownloadRolePermissions
		WebDAVLogEvents     bool
	}
	Git struct {
		GitCommand   string
		GitoliteHome string
		Repositories string
	}
	Login struct {
		LDAP struct {
			Enable             bool
			URL                URL
			StartTLS           bool
			InsecureTLS        bool
			MinTLSVersion      TLSVersion
			StripDomain        string
			AppendDomain       string
			SearchAttribute    string
			SearchBindUser     string
			SearchBindPassword string
			SearchBase         string
			SearchFilters      string
			EmailAttribute     string
			UsernameAttribute  string
		}
		Google struct {
			Enable                          bool
			ClientID                        string
			ClientSecret                    string
			AlternateEmailAddresses         bool
			AuthenticationRequestParameters map[string]string
		}
		OpenIDConnect struct {
			Enable                          bool
			Issuer                          string
			ClientID                        string
			ClientSecret                    string
			EmailClaim                      string
			EmailVerifiedClaim              string
			UsernameClaim                   string
			AcceptAccessToken               bool
			AcceptAccessTokenScope          string
			AuthenticationRequestParameters map[string]string
		}
		PAM struct {
			Enable             bool
			Service            string
			DefaultEmailDomain string
		}
		Test struct {
			Enable bool
			Users  map[string]TestUser
		}
		LoginCluster         string
		RemoteTokenRefresh   Duration
		TokenLifetime        Duration
		TrustedClients       map[URL]struct{}
		TrustPrivateNetworks bool
		IssueTrustedTokens   bool
	}
	Mail struct {
		MailchimpAPIKey                string
		MailchimpListID                string
		SendUserSetupNotificationEmail bool
		IssueReporterEmailFrom         string
		IssueReporterEmailTo           string
		SupportEmailAddress            string
		EmailFrom                      string
	}
	SystemLogs struct {
		LogLevel                  string
		Format                    string
		MaxRequestLogParamsSize   int
		RequestQueueDumpDirectory string
	}
	TLS struct {
		Certificate string
		Key         string
		Insecure    bool
		ACME        struct {
			Server string
		}
	}
	Users struct {
		ActivatedUsersAreVisibleToOthers      bool
		AnonymousUserToken                    string
		AdminNotifierEmailFrom                string
		AutoAdminFirstUser                    bool
		AutoAdminUserWithEmail                string
		AutoSetupNewUsers                     bool
		AutoSetupNewUsersWithRepository       bool
		AutoSetupNewUsersWithVmUUID           string
		AutoSetupUsernameBlacklist            StringSet
		EmailSubjectPrefix                    string
		NewInactiveUserNotificationRecipients StringSet
		NewUserNotificationRecipients         StringSet
		NewUsersAreActive                     bool
		UserNotifierEmailFrom                 string
		UserNotifierEmailBcc                  StringSet
		UserProfileNotificationAddress        string
		PreferDomainForUsername               string
		UserSetupMailText                     string
		RoleGroupsVisibleToAll                bool
		CanCreateRoleGroups                   bool
		ActivityLoggingPeriod                 Duration
		SyncIgnoredGroups                     []string
		SyncRequiredGroups                    []string
		SyncUserAccounts                      bool
		SyncUserAPITokens                     bool
		SyncUserGroups                        bool
		SyncUserSSHKeys                       bool
	}
	StorageClasses map[string]StorageClassConfig
	Volumes        map[string]Volume
	Workbench      struct {
		ActivationContactLink   string
		ArvadosDocsite          string
		ArvadosPublicDataDocURL string
		DisableSharingURLsUI    bool
		FileViewersConfigURL    string
		ShowUserAgreementInline bool
		SiteName                string
		Theme                   string
		UserProfileFormFields   map[string]struct {
			Type                 string
			FormFieldTitle       string
			FormFieldDescription string
			Required             bool
			Position             int
			Options              map[string]struct{}
		}
		UserProfileFormMessage string
		WelcomePageHTML        string
		InactivePageHTML       string
		SSHHelpPageHTML        string
		SSHHelpHostSuffix      string
		IdleTimeout            Duration
		BannerUUID             string
	}
}

func IntegrationTestCluster

func IntegrationTestCluster() *Cluster

IntegrationTestCluster returns the cluster that has been set up by the integration test framework (see /build/run-tests.sh). It panics on error.

type Collection

type Collection struct {
	UUID                      string                 `json:"uuid"`
	Etag                      string                 `json:"etag"`
	OwnerUUID                 string                 `json:"owner_uuid"`
	TrashAt                   *time.Time             `json:"trash_at"`
	ManifestText              string                 `json:"manifest_text"`
	UnsignedManifestText      string                 `json:"unsigned_manifest_text"`
	Name                      string                 `json:"name"`
	CreatedAt                 time.Time              `json:"created_at"`
	ModifiedAt                time.Time              `json:"modified_at"`
	ModifiedByClientUUID      string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID        string                 `json:"modified_by_user_uuid"`
	PortableDataHash          string                 `json:"portable_data_hash"`
	ReplicationConfirmed      *int                   `json:"replication_confirmed"`
	ReplicationConfirmedAt    *time.Time             `json:"replication_confirmed_at"`
	ReplicationDesired        *int                   `json:"replication_desired"`
	StorageClassesDesired     []string               `json:"storage_classes_desired"`
	StorageClassesConfirmed   []string               `json:"storage_classes_confirmed"`
	StorageClassesConfirmedAt *time.Time             `json:"storage_classes_confirmed_at"`
	DeleteAt                  *time.Time             `json:"delete_at"`
	IsTrashed                 bool                   `json:"is_trashed"`
	Properties                map[string]interface{} `json:"properties"`
	WritableBy                []string               `json:"writable_by,omitempty"`
	FileCount                 int                    `json:"file_count"`
	FileSizeTotal             int64                  `json:"file_size_total"`
	Version                   int                    `json:"version"`
	PreserveVersion           bool                   `json:"preserve_version"`
	CurrentVersionUUID        string                 `json:"current_version_uuid"`
	Description               string                 `json:"description"`
}

Collection is an arvados#collection resource.

func (*Collection) FileSystem

func (c *Collection) FileSystem(client apiClient, kc keepClient) (CollectionFileSystem, error)

FileSystem returns a CollectionFileSystem for the collection.

func (*Collection) SizedDigests

func (c *Collection) SizedDigests() ([]SizedDigest, error)

SizedDigests returns the hash+size part of each data block referenced by the collection.

Zero-length blocks are not included.

type CollectionFileSystem

type CollectionFileSystem interface {
	FileSystem

	// Flush all file data to Keep and return a snapshot of the
	// filesystem suitable for saving as (Collection)ManifestText.
	// Prefix (normally ".") is a top level directory, effectively
	// prepended to all paths in the returned manifest.
	MarshalManifest(prefix string) (string, error)

	// Total data bytes in all files.
	Size() int64
}

A CollectionFileSystem is a FileSystem that can be serialized as a manifest and stored as a collection.

type CollectionList

type CollectionList struct {
	Items          []Collection `json:"items"`
	ItemsAvailable int          `json:"items_available"`
	Offset         int          `json:"offset"`
	Limit          int          `json:"limit"`
}

type Config

type Config struct {
	Clusters         map[string]Cluster
	AutoReloadConfig bool
	SourceTimestamp  time.Time
	SourceSHA256     string
}

func GetConfig

func GetConfig(configFile string) (*Config, error)

GetConfig returns the current system config, loading it from configFile if needed.

func (*Config) GetCluster

func (sc *Config) GetCluster(clusterID string) (*Cluster, error)

GetCluster returns the cluster ID and config for the given cluster, or the default/only configured cluster if clusterID is "".

type ConnectionResponse

type ConnectionResponse struct {
	Conn   net.Conn           `json:"-"`
	Bufrw  *bufio.ReadWriter  `json:"-"`
	Logger logrus.FieldLogger `json:"-"`
	Header http.Header        `json:"-"`
}

func (ConnectionResponse) ServeHTTP

func (cresp ConnectionResponse) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Container

type Container struct {
	UUID                      string                 `json:"uuid"`
	Etag                      string                 `json:"etag"`
	CreatedAt                 time.Time              `json:"created_at"`
	ModifiedByClientUUID      string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID        string                 `json:"modified_by_user_uuid"`
	ModifiedAt                time.Time              `json:"modified_at"`
	Command                   []string               `json:"command"`
	ContainerImage            string                 `json:"container_image"`
	Cwd                       string                 `json:"cwd"`
	Environment               map[string]string      `json:"environment"`
	LockedByUUID              string                 `json:"locked_by_uuid"`
	LockCount                 int                    `json:"lock_count"`
	Mounts                    map[string]Mount       `json:"mounts"`
	Output                    string                 `json:"output"`
	OutputPath                string                 `json:"output_path"`
	Priority                  int64                  `json:"priority"`
	RuntimeConstraints        RuntimeConstraints     `json:"runtime_constraints"`
	State                     ContainerState         `json:"state"`
	SchedulingParameters      SchedulingParameters   `json:"scheduling_parameters"`
	ExitCode                  int                    `json:"exit_code"`
	RuntimeStatus             map[string]interface{} `json:"runtime_status"`
	StartedAt                 *time.Time             `json:"started_at"`  // nil if not yet started
	FinishedAt                *time.Time             `json:"finished_at"` // nil if not yet finished
	GatewayAddress            string                 `json:"gateway_address"`
	InteractiveSessionStarted bool                   `json:"interactive_session_started"`
	OutputStorageClasses      []string               `json:"output_storage_classes"`
	RuntimeUserUUID           string                 `json:"runtime_user_uuid"`
	RuntimeAuthScopes         []string               `json:"runtime_auth_scopes"`
	RuntimeToken              string                 `json:"runtime_token"`
	AuthUUID                  string                 `json:"auth_uuid"`
	Log                       string                 `json:"log"`
	Cost                      float64                `json:"cost"`
	SubrequestsCost           float64                `json:"subrequests_cost"`
}

Container is an arvados#container resource.

type ContainerGatewayTunnelOptions

type ContainerGatewayTunnelOptions struct {
	UUID       string `json:"uuid"`
	AuthSecret string `json:"auth_secret"`
}

type ContainerList

type ContainerList struct {
	Items          []Container `json:"items"`
	ItemsAvailable int         `json:"items_available"`
	Offset         int         `json:"offset"`
	Limit          int         `json:"limit"`
}

ContainerList is an arvados#containerList resource.

type ContainerLogOptions

type ContainerLogOptions struct {
	UUID      string `json:"uuid"`
	NoForward bool   `json:"no_forward"`
	WebDAVOptions
}

type ContainerRequest

type ContainerRequest struct {
	UUID                    string                 `json:"uuid"`
	OwnerUUID               string                 `json:"owner_uuid"`
	CreatedAt               time.Time              `json:"created_at"`
	ModifiedByClientUUID    string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID      string                 `json:"modified_by_user_uuid"`
	ModifiedAt              time.Time              `json:"modified_at"`
	Href                    string                 `json:"href"`
	Etag                    string                 `json:"etag"`
	Name                    string                 `json:"name"`
	Description             string                 `json:"description"`
	Properties              map[string]interface{} `json:"properties"`
	State                   ContainerRequestState  `json:"state"`
	RequestingContainerUUID string                 `json:"requesting_container_uuid"`
	ContainerUUID           string                 `json:"container_uuid"`
	ContainerCountMax       int                    `json:"container_count_max"`
	Mounts                  map[string]Mount       `json:"mounts"`
	RuntimeConstraints      RuntimeConstraints     `json:"runtime_constraints"`
	SchedulingParameters    SchedulingParameters   `json:"scheduling_parameters"`
	ContainerImage          string                 `json:"container_image"`
	Environment             map[string]string      `json:"environment"`
	Cwd                     string                 `json:"cwd"`
	Command                 []string               `json:"command"`
	OutputPath              string                 `json:"output_path"`
	OutputName              string                 `json:"output_name"`
	OutputTTL               int                    `json:"output_ttl"`
	Priority                int                    `json:"priority"`
	UseExisting             bool                   `json:"use_existing"`
	LogUUID                 string                 `json:"log_uuid"`
	OutputUUID              string                 `json:"output_uuid"`
	RuntimeToken            string                 `json:"runtime_token"`
	ExpiresAt               time.Time              `json:"expires_at"`
	Filters                 []Filter               `json:"filters"`
	ContainerCount          int                    `json:"container_count"`
	OutputStorageClasses    []string               `json:"output_storage_classes"`
	OutputProperties        map[string]interface{} `json:"output_properties"`
	CumulativeCost          float64                `json:"cumulative_cost"`
}

ContainerRequest is an arvados#container_request resource.

type ContainerRequestList

type ContainerRequestList struct {
	Items          []ContainerRequest `json:"items"`
	ItemsAvailable int                `json:"items_available"`
	Offset         int                `json:"offset"`
	Limit          int                `json:"limit"`
}

ContainerRequestList is an arvados#containerRequestList resource.

type ContainerRequestState

type ContainerRequestState string

ContainerRequestState is a string corresponding to a valid Container Request state.

type ContainerSSHOptions

type ContainerSSHOptions struct {
	UUID          string `json:"uuid"`
	DetachKeys    string `json:"detach_keys"`
	LoginUsername string `json:"login_username"`
	NoForward     bool   `json:"no_forward"`
}

type ContainerState

type ContainerState string

ContainerState is a string corresponding to a valid Container state.

type ContainerStatus

type ContainerStatus struct {
	UUID             string         `json:"uuid"`
	State            ContainerState `json:"container_state"`
	SchedulingStatus string         `json:"scheduling_status"`
}

type ContainersConfig

type ContainersConfig struct {
	CloudVMs                      CloudVMsConfig
	CrunchRunCommand              string
	CrunchRunArgumentsList        []string
	DefaultKeepCacheRAM           ByteSize
	DispatchPrivateKey            string
	LogReuseDecisions             bool
	MaxDispatchAttempts           int
	MaxRetryAttempts              int
	MinRetryPeriod                Duration
	ReserveExtraRAM               ByteSize
	StaleLockTimeout              Duration
	SupportedDockerImageFormats   StringSet
	AlwaysUsePreemptibleInstances bool
	PreemptiblePriceFactor        float64
	MaximumPriceFactor            float64
	RuntimeEngine                 string
	LocalKeepBlobBuffersPerVCPU   int
	LocalKeepLogsToContainerLog   string

	JobsAPI struct {
		Enable         string
		GitInternalDir string
	}
	Logging struct {
		MaxAge                       Duration
		SweepInterval                Duration
		LogBytesPerEvent             int
		LogSecondsBetweenEvents      Duration
		LogThrottlePeriod            Duration
		LogThrottleBytes             int
		LogThrottleLines             int
		LimitLogBytesPerJob          int
		LogPartialLineThrottlePeriod Duration
		LogUpdatePeriod              Duration
		LogUpdateSize                ByteSize
	}
	ShellAccess struct {
		Admin bool
		User  bool
	}
	SLURM struct {
		PrioritySpread             int64
		SbatchArgumentsList        []string
		SbatchEnvironmentVariables map[string]string
		Managed                    struct {
			DNSServerConfDir       string
			DNSServerConfTemplate  string
			DNSServerReloadCommand string
			DNSServerUpdateCommand string
			ComputeNodeDomain      string
			ComputeNodeNameservers StringSet
			AssignNodeHostname     string
		}
	}
	LSF struct {
		BsubSudoUser       string
		BsubArgumentsList  []string
		BsubCUDAArguments  []string
		MaxRunTimeOverhead Duration
		MaxRunTimeDefault  Duration
	}
}

type CreateOptions

type CreateOptions struct {
	ClusterID        string                 `json:"cluster_id"`
	EnsureUniqueName bool                   `json:"ensure_unique_name"`
	Select           []string               `json:"select"`
	Attrs            map[string]interface{} `json:"attrs"`
	// ReplaceFiles only applies when creating a collection.
	ReplaceFiles map[string]string `json:"replace_files"`
}

type CustomFileSystem

type CustomFileSystem interface {
	FileSystem
	MountByID(mount string)
	MountProject(mount, uuid string)
	MountUsers(mount string)
	ForwardSlashNameSubstitution(string)
}

type DeleteOptions

type DeleteOptions struct {
	UUID string `json:"uuid"`
}

type DirectoryVolumeDriverParameters

type DirectoryVolumeDriverParameters struct {
	Root      string
	Serialize bool
}

type DiscoveryDocument

type DiscoveryDocument struct {
	BasePath                     string              `json:"basePath"`
	DefaultCollectionReplication int                 `json:"defaultCollectionReplication"`
	BlobSignatureTTL             int64               `json:"blobSignatureTtl"`
	GitURL                       string              `json:"gitUrl"`
	Schemas                      map[string]Schema   `json:"schemas"`
	Resources                    map[string]Resource `json:"resources"`
	Revision                     string              `json:"revision"`
}

DiscoveryDocument is the Arvados server's description of itself.

type DiskCache

type DiskCache struct {
	KeepGateway
	Dir     string
	MaxSize ByteSizeOrPercent
	Logger  logrus.FieldLogger
	// contains filtered or unexported fields
}

DiskCache wraps KeepGateway, adding a disk-based cache layer.

A DiskCache is automatically incorporated into the backend stack of each keepclient.KeepClient. Most programs do not need to use DiskCache directly.

func (*DiskCache) BlockRead

func (cache *DiskCache) BlockRead(ctx context.Context, opts BlockReadOptions) (int, error)

BlockRead reads an entire block using a 128 KiB buffer.

func (*DiskCache) BlockWrite

func (cache *DiskCache) BlockWrite(ctx context.Context, opts BlockWriteOptions) (BlockWriteResponse, error)

BlockWrite writes through to the wrapped KeepGateway, and (if possible) retains a copy of the written block in the cache.

func (*DiskCache) ReadAt

func (cache *DiskCache) ReadAt(locator string, dst []byte, offset int) (int, error)

ReadAt reads the entire block from the wrapped KeepGateway into the cache if needed, and copies the requested portion into the provided slice.

ReadAt returns as soon as the requested portion is available in the cache. The remainder of the block may continue to be copied into the cache in the background.

type Duration

type Duration time.Duration

Duration is time.Duration but looks like "12s" in JSON, rather than a number of nanoseconds.

func (Duration) Duration

func (d Duration) Duration() time.Duration

Duration returns a time.Duration.

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Duration) Set

func (d *Duration) Set(s string) error

Set implements the flag.Value interface and sets the duration value by using time.ParseDuration to parse the string.

func (Duration) String

func (d Duration) String() string

String returns a format similar to (time.Duration)String() but with "0m" and "0s" removed: e.g., "1h" instead of "1h0m0s".

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type File

type File interface {
	io.Reader
	io.Writer
	io.Closer
	io.Seeker
	Size() int64
	Readdir(int) ([]os.FileInfo, error)
	Stat() (os.FileInfo, error)
	Truncate(int64) error
	Sync() error
	// Create a snapshot of a file or directory tree, which can
	// then be spliced onto a different path or a different
	// collection.
	Snapshot() (*Subtree, error)
	// Replace this file or directory with the given snapshot.
	// The target must be inside a collection: Splice returns an
	// error if the File is a virtual file or directory like
	// by_id, a project directory, .arvados#collection,
	// etc. Splice can replace directories with regular files and
	// vice versa, except it cannot replace the root directory of
	// a collection with a regular file.
	Splice(snapshot *Subtree) error
}

A File is an *os.File-like interface for reading and writing files in a FileSystem.

type FileSystem

type FileSystem interface {
	http.FileSystem

	// analogous to os.Stat()
	Stat(name string) (os.FileInfo, error)

	// analogous to os.Create(): create/truncate a file and open it O_RDWR.
	Create(name string) (File, error)

	// Like os.OpenFile(): create or open a file or directory.
	//
	// If flag&os.O_EXCL==0, it opens an existing file or
	// directory if one exists. If flag&os.O_CREATE!=0, it creates
	// a new empty file or directory if one does not already
	// exist.
	//
	// When creating a new item, perm&os.ModeDir determines
	// whether it is a file or a directory.
	//
	// A file can be opened multiple times and used concurrently
	// from multiple goroutines. However, each File object should
	// be used by only one goroutine at a time.
	OpenFile(name string, flag int, perm os.FileMode) (File, error)

	Mkdir(name string, perm os.FileMode) error
	Remove(name string) error
	RemoveAll(name string) error
	Rename(oldname, newname string) error

	// Write buffered data from memory to storage, returning when
	// all updates have been saved to persistent storage.
	Sync() error

	// Write buffered data from memory to storage, but don't wait
	// for all writes to finish before returning. If shortBlocks
	// is true, flush everything; otherwise, if there's less than
	// a full block of buffered data at the end of a stream, leave
	// it buffered in memory in case more data can be appended. If
	// path is "", flush all dirs/streams; otherwise, flush only
	// the specified dir/stream.
	Flush(path string, shortBlocks bool) error

	// Estimate current memory usage.
	MemorySize() int64
	// contains filtered or unexported methods
}

A FileSystem is an http.Filesystem plus Stat() and support for opening writable files. All methods are safe to call from multiple goroutines.

type Filter

type Filter struct {
	Attr     string
	Operator string
	Operand  interface{}
}

A Filter restricts the set of records returned by a list/index API.

func (*Filter) MarshalJSON

func (f *Filter) MarshalJSON() ([]byte, error)

MarshalJSON encodes a Filter to a JSON array.

func (*Filter) UnmarshalJSON

func (f *Filter) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a JSON array to a Filter.

type GetOptions

type GetOptions struct {
	UUID         string   `json:"uuid,omitempty"`
	Select       []string `json:"select"`
	IncludeTrash bool     `json:"include_trash"`
	ForwardedFor string   `json:"forwarded_for,omitempty"`
	Remote       string   `json:"remote,omitempty"`
}

type Group

type Group struct {
	UUID                 string                 `json:"uuid"`
	Name                 string                 `json:"name"`
	OwnerUUID            string                 `json:"owner_uuid"`
	GroupClass           string                 `json:"group_class"`
	Etag                 string                 `json:"etag"`
	Href                 string                 `json:"href"`
	TrashAt              *time.Time             `json:"trash_at"`
	CreatedAt            time.Time              `json:"created_at"`
	ModifiedAt           time.Time              `json:"modified_at"`
	ModifiedByClientUUID string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID   string                 `json:"modified_by_user_uuid"`
	DeleteAt             *time.Time             `json:"delete_at"`
	IsTrashed            bool                   `json:"is_trashed"`
	Properties           map[string]interface{} `json:"properties"`
	WritableBy           []string               `json:"writable_by,omitempty"`
	Description          string                 `json:"description"`
	FrozenByUUID         string                 `json:"frozen_by_uuid"`
	CanWrite             bool                   `json:"can_write"`
	CanManage            bool                   `json:"can_manage"`
}

Group is an arvados#group record

type GroupContentsOptions

type GroupContentsOptions struct {
	ClusterID          string   `json:"cluster_id"`
	UUID               string   `json:"uuid,omitempty"`
	Select             []string `json:"select"`
	Filters            []Filter `json:"filters"`
	Limit              int64    `json:"limit"`
	Offset             int64    `json:"offset"`
	Order              []string `json:"order"`
	Distinct           bool     `json:"distinct"`
	Count              string   `json:"count"`
	Include            string   `json:"include"`
	Recursive          bool     `json:"recursive"`
	IncludeTrash       bool     `json:"include_trash"`
	IncludeOldVersions bool     `json:"include_old_versions"`
	ExcludeHomeProject bool     `json:"exclude_home_project"`
}

type GroupList

type GroupList struct {
	Items          []Group       `json:"items"`
	ItemsAvailable int           `json:"items_available"`
	Offset         int           `json:"offset"`
	Limit          int           `json:"limit"`
	Included       []interface{} `json:"included"`
}

GroupList is an arvados#groupList resource.

type InstanceType

type InstanceType struct {
	Name            string `json:"-"`
	ProviderType    string
	VCPUs           int
	RAM             ByteSize
	Scratch         ByteSize `json:"-"`
	IncludedScratch ByteSize
	AddedScratch    ByteSize
	Price           float64
	Preemptible     bool
	CUDA            CUDAFeatures
}

type InstanceTypeMap

type InstanceTypeMap map[string]InstanceType

func (*InstanceTypeMap) UnmarshalJSON

func (it *InstanceTypeMap) UnmarshalJSON(data []byte) error

UnmarshalJSON does special handling of InstanceTypes:

- populate computed fields (Name and Scratch)

- error out if InstancesTypes are populated as an array, which was deprecated in Arvados 1.2.0

type Job

type Job struct {
	UUID                   string                 `json:"uuid"`
	Etag                   string                 `json:"etag"`
	OwnerUUID              string                 `json:"owner_uuid"`
	ModifiedByClientUUID   string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID     string                 `json:"modified_by_user_uuid"`
	ModifiedAt             time.Time              `json:"modified_at"`
	SubmitID               string                 `json:"submit_id"`
	Script                 string                 `json:"script"`
	CancelledByClientUUID  string                 `json:"cancelled_by_client_uuid"`
	CancelledByUserUUID    string                 `json:"cancelled_by_user_uuid"`
	CancelledAt            time.Time              `json:"cancelled_at"`
	StartedAt              time.Time              `json:"started_at"`
	FinishedAt             time.Time              `json:"finished_at"`
	Running                bool                   `json:"running"`
	Success                bool                   `json:"success"`
	Output                 string                 `json:"output"`
	CreatedAt              time.Time              `json:"created_at"`
	UpdatedAt              time.Time              `json:"updated_at"`
	IsLockedByUUID         string                 `json:"is_locked_by_uuid"`
	Log                    string                 `json:"log"`
	TasksSummary           map[string]interface{} `json:"tasks_summary"`
	RuntimeConstraints     map[string]interface{} `json:"runtime_constraints"`
	Nondeterministic       bool                   `json:"nondeterministic"`
	Repository             string                 `json:"repository"`
	SuppliedScriptVersion  string                 `json:"supplied_script_version"`
	DockerImageLocator     string                 `json:"docker_image_locator"`
	Priority               int                    `json:"priority"`
	Description            string                 `json:"description"`
	State                  string                 `json:"state"`
	ArvadosSDKVersion      string                 `json:"arvados_sdk_version"`
	Components             map[string]interface{} `json:"components"`
	ScriptParametersDigest string                 `json:"script_parameters_digest"`
	WritableBy             []string               `json:"writable_by,omitempty"`
}

Job is an arvados#job record

type KeepGateway

type KeepGateway interface {
	ReadAt(locator string, dst []byte, offset int) (int, error)
	BlockRead(ctx context.Context, opts BlockReadOptions) (int, error)
	BlockWrite(ctx context.Context, opts BlockWriteOptions) (BlockWriteResponse, error)
	LocalLocator(locator string) (string, error)
}

type KeepMount

type KeepMount struct {
	UUID           string          `json:"uuid"`
	DeviceID       string          `json:"device_id"`
	AllowWrite     bool            `json:"allow_write"`
	AllowTrash     bool            `json:"allow_trash"`
	Replication    int             `json:"replication"`
	StorageClasses map[string]bool `json:"storage_classes"`
}

type KeepService

type KeepService struct {
	UUID           string    `json:"uuid"`
	ServiceHost    string    `json:"service_host"`
	ServicePort    int       `json:"service_port"`
	ServiceSSLFlag bool      `json:"service_ssl_flag"`
	ServiceType    string    `json:"service_type"`
	ReadOnly       bool      `json:"read_only"`
	CreatedAt      time.Time `json:"created_at"`
	ModifiedAt     time.Time `json:"modified_at"`
}

KeepService is an arvados#keepService record

func (*KeepService) Index

func (s *KeepService) Index(ctx context.Context, c *Client, prefix string) ([]KeepServiceIndexEntry, error)

Index returns an unsorted list of blocks that can be retrieved from this server.

func (*KeepService) IndexMount

func (s *KeepService) IndexMount(ctx context.Context, c *Client, mountUUID string, prefix string) ([]KeepServiceIndexEntry, error)

IndexMount returns an unsorted list of blocks at the given mount point.

func (*KeepService) Mounts

func (s *KeepService) Mounts(c *Client) ([]KeepMount, error)

func (*KeepService) String

func (s *KeepService) String() string

String implements fmt.Stringer

func (*KeepService) Touch

func (s *KeepService) Touch(ctx context.Context, c *Client, blk string) error

Touch updates the timestamp on the given block.

func (*KeepService) Untrash

func (s *KeepService) Untrash(ctx context.Context, c *Client, blk string) error

Untrash moves/copies the given block out of trash.

type KeepServiceIndexEntry

type KeepServiceIndexEntry struct {
	SizedDigest
	// Time of last write, in nanoseconds since Unix epoch
	Mtime int64
}

KeepServiceIndexEntry is what a keep service's index response tells us about a stored block.

type KeepServiceList

type KeepServiceList struct {
	Items          []KeepService `json:"items"`
	ItemsAvailable int           `json:"items_available"`
	Offset         int           `json:"offset"`
	Limit          int           `json:"limit"`
}

KeepServiceList is an arvados#keepServiceList record

type Link struct {
	UUID                 string                 `json:"uuid,omitempty"`
	Etag                 string                 `json:"etag"`
	Href                 string                 `json:"href"`
	OwnerUUID            string                 `json:"owner_uuid"`
	Name                 string                 `json:"name"`
	LinkClass            string                 `json:"link_class"`
	CreatedAt            time.Time              `json:"created_at"`
	ModifiedAt           time.Time              `json:"modified_at"`
	ModifiedByClientUUID string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID   string                 `json:"modified_by_user_uuid"`
	HeadUUID             string                 `json:"head_uuid"`
	HeadKind             string                 `json:"head_kind"`
	TailUUID             string                 `json:"tail_uuid"`
	TailKind             string                 `json:"tail_kind"`
	Properties           map[string]interface{} `json:"properties"`
}

Link is an arvados#link record

type LinkList struct {
	Items          []Link `json:"items"`
	ItemsAvailable int    `json:"items_available"`
	Offset         int    `json:"offset"`
	Limit          int    `json:"limit"`
}

LinkList is an arvados#linkList resource.

type ListOptions

type ListOptions struct {
	ClusterID          string                 `json:"cluster_id"`
	Select             []string               `json:"select"`
	Filters            []Filter               `json:"filters"`
	Where              map[string]interface{} `json:"where"`
	Limit              int64                  `json:"limit"`
	Offset             int64                  `json:"offset"`
	Order              []string               `json:"order"`
	Distinct           bool                   `json:"distinct"`
	Count              string                 `json:"count"`
	IncludeTrash       bool                   `json:"include_trash"`
	IncludeOldVersions bool                   `json:"include_old_versions"`
	BypassFederation   bool                   `json:"bypass_federation"`
	ForwardedFor       string                 `json:"forwarded_for,omitempty"`
	Include            string                 `json:"include"`
}

type Log

type Log struct {
	ID              int64                  `json:"id"`
	UUID            string                 `json:"uuid"`
	OwnerUUID       string                 `json:"owner_uuid"`
	ObjectUUID      string                 `json:"object_uuid"`
	ObjectOwnerUUID string                 `json:"object_owner_uuid"`
	EventType       string                 `json:"event_type"`
	EventAt         time.Time              `json:"event"`
	Summary         string                 `json:"summary"`
	Properties      map[string]interface{} `json:"properties"`
	CreatedAt       time.Time              `json:"created_at"`
	ModifiedAt      time.Time              `json:"modified_at"`
}

Log is an arvados#log record

type LogList

type LogList struct {
	Items          []Log `json:"items"`
	ItemsAvailable int   `json:"items_available"`
	Offset         int   `json:"offset"`
	Limit          int   `json:"limit"`
}

LogList is an arvados#logList resource.

type LoginOptions

type LoginOptions struct {
	ReturnTo string `json:"return_to"`        // On success, redirect to this target with api_token=xxx query param
	Remote   string `json:"remote,omitempty"` // Salt token for remote Cluster ID
	Code     string `json:"code,omitempty"`   // OAuth2 callback code
	State    string `json:"state,omitempty"`  // OAuth2 callback state
}

type LoginResponse

type LoginResponse struct {
	RedirectLocation string       `json:"redirect_location,omitempty"`
	HTML             bytes.Buffer `json:"-"`
}

func (LoginResponse) ServeHTTP

func (resp LoginResponse) ServeHTTP(w http.ResponseWriter, req *http.Request)

type LogoutOptions

type LogoutOptions struct {
	ReturnTo string `json:"return_to"` // Redirect to this URL after logging out
}

type LogoutResponse

type LogoutResponse struct {
	RedirectLocation string `json:"redirect_location,omitempty"`
}

func (LogoutResponse) ServeHTTP

func (resp LogoutResponse) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ManagedProperties

type ManagedProperties map[string]struct {
	Value     interface{}
	Function  string
	Protected bool
}

type MethodResponse

type MethodResponse struct {
	Ref string `json:"$ref"`
}

type Mount

type Mount struct {
	Kind              string      `json:"kind"`
	Writable          bool        `json:"writable"`
	PortableDataHash  string      `json:"portable_data_hash"`
	UUID              string      `json:"uuid"`
	DeviceType        string      `json:"device_type"`
	Path              string      `json:"path"`
	Content           interface{} `json:"content"`
	ExcludeFromOutput bool        `json:"exclude_from_output"`
	Capacity          int64       `json:"capacity"`
	Commit            string      `json:"commit"`          // only if kind=="git_tree"
	RepositoryName    string      `json:"repository_name"` // only if kind=="git_tree"
	GitURL            string      `json:"git_url"`         // only if kind=="git_tree"
}

Mount is special behavior to attach to a filesystem path or device.

type Node

type Node struct {
	UUID       string         `json:"uuid"`
	Domain     string         `json:"domain"`
	Hostname   string         `json:"hostname"`
	IPAddress  string         `json:"ip_address"`
	LastPingAt *time.Time     `json:"last_ping_at"`
	SlotNumber int            `json:"slot_number"`
	Status     string         `json:"status"`
	JobUUID    string         `json:"job_uuid"`
	Properties NodeProperties `json:"properties"`
}

Node is an arvados#node resource.

type NodeList

type NodeList struct {
	Items          []Node `json:"items"`
	ItemsAvailable int    `json:"items_available"`
	Offset         int    `json:"offset"`
	Limit          int    `json:"limit"`
}

NodeList is an arvados#nodeList resource.

type NodeProperties

type NodeProperties struct {
	CloudNode      NodePropertiesCloudNode `json:"cloud_node"`
	TotalCPUCores  int                     `json:"total_cpu_cores,omitempty"`
	TotalScratchMB int64                   `json:"total_scratch_mb,omitempty"`
	TotalRAMMB     int64                   `json:"total_ram_mb,omitempty"`
}

type NodePropertiesCloudNode

type NodePropertiesCloudNode struct {
	Size  string  `json:"size,omitempty"`
	Price float64 `json:"price"`
}

type ObjectList

type ObjectList struct {
	Included       []interface{} `json:"included"`
	Items          []interface{} `json:"items"`
	ItemsAvailable int           `json:"items_available"`
	Offset         int           `json:"offset"`
	Limit          int           `json:"limit"`
}

ObjectList is an arvados#objectList resource.

type PipelineInstance

type PipelineInstance struct {
	UUID                 string                 `json:"uuid"`
	Etag                 string                 `json:"etag"`
	OwnerUUID            string                 `json:"owner_uuid"`
	CreatedAt            time.Time              `json:"created_at"`
	ModifiedByClientUUID string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID   string                 `json:"modified_by_user_uuid"`
	ModifiedAt           time.Time              `json:"modified_at"`
	PipelineTemplateUUID string                 `json:"pipeline_template_uuid"`
	Name                 string                 `json:"name"`
	Components           map[string]interface{} `json:"components"`
	UpdatedAt            time.Time              `json:"updated_at"`
	Properties           map[string]interface{} `json:"properties"`
	State                string                 `json:"state"`
	ComponentsSummary    map[string]interface{} `json:"components_summary"`
	StartedAt            time.Time              `json:"started_at"`
	FinishedAt           time.Time              `json:"finished_at"`
	Description          string                 `json:"description"`
	WritableBy           []string               `json:"writable_by,omitempty"`
}

PipelineInstance is an arvados#pipelineInstance record

type PipelineTemplate

type PipelineTemplate struct {
	UUID                 string                 `json:"uuid"`
	Etag                 string                 `json:"etag"`
	OwnerUUID            string                 `json:"owner_uuid"`
	CreatedAt            time.Time              `json:"created_at"`
	ModifiedByClientUUID string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID   string                 `json:"modified_by_user_uuid"`
	ModifiedAt           time.Time              `json:"modified_at"`
	Name                 string                 `json:"name"`
	Components           map[string]interface{} `json:"components"`
	UpdatedAt            time.Time              `json:"updated_at"`
	Description          string                 `json:"description"`
	WritableBy           []string               `json:"writable_by,omitempty"`
}

PipelineTemplate is an arvados#pipelineTemplate record

type PostgreSQL

type PostgreSQL struct {
	Connection     PostgreSQLConnection
	ConnectionPool int
}

type PostgreSQLConnection

type PostgreSQLConnection map[string]string

func (PostgreSQLConnection) String

func (c PostgreSQLConnection) String() string

type RemoteCluster

type RemoteCluster struct {
	Host          string
	Proxy         bool
	Scheme        string
	Insecure      bool
	ActivateUsers bool
}

type Resource

type Resource struct {
	Methods map[string]ResourceMethod `json:"methods"`
}

type ResourceListParams

type ResourceListParams struct {
	Select             []string `json:"select,omitempty"`
	Filters            []Filter `json:"filters,omitempty"`
	IncludeTrash       bool     `json:"include_trash,omitempty"`
	IncludeOldVersions bool     `json:"include_old_versions,omitempty"`
	Limit              *int     `json:"limit,omitempty"`
	Offset             int      `json:"offset,omitempty"`
	Order              string   `json:"order,omitempty"`
	Distinct           bool     `json:"distinct,omitempty"`
	Count              string   `json:"count,omitempty"`
}

ResourceListParams expresses which results are requested in a list/index API.

type ResourceMethod

type ResourceMethod struct {
	HTTPMethod string         `json:"httpMethod"`
	Path       string         `json:"path"`
	Response   MethodResponse `json:"response"`
}

type RuntimeConstraints

type RuntimeConstraints struct {
	API           bool                   `json:"API"`
	RAM           int64                  `json:"ram"`
	VCPUs         int                    `json:"vcpus"`
	KeepCacheRAM  int64                  `json:"keep_cache_ram"`
	KeepCacheDisk int64                  `json:"keep_cache_disk"`
	CUDA          CUDARuntimeConstraints `json:"cuda"`
}

RuntimeConstraints specify a container's compute resources (RAM, CPU) and network connectivity.

type S3VolumeDriverParameters

type S3VolumeDriverParameters struct {
	IAMRole            string
	AccessKeyID        string
	SecretAccessKey    string
	Endpoint           string
	Region             string
	Bucket             string
	LocationConstraint bool
	V2Signature        bool
	IndexPageSize      int
	ConnectTimeout     Duration
	ReadTimeout        Duration
	RaceWindow         Duration
	UnsafeDelete       bool
	PrefixLength       int
}

type SchedulingParameters

type SchedulingParameters struct {
	Partitions  []string `json:"partitions"`
	Preemptible bool     `json:"preemptible"`
	MaxRunTime  int      `json:"max_run_time"`
	Supervisor  bool     `json:"supervisor"`
}

SchedulingParameters specify a container's scheduling parameters such as Partitions

type Schema

type Schema struct {
	UUIDPrefix string `json:"uuidPrefix"`
}

type Service

type Service struct {
	InternalURLs map[URL]ServiceInstance
	ExternalURL  URL
}

type ServiceInstance

type ServiceInstance struct {
	ListenURL  URL
	Rendezvous string `json:",omitempty"`
}

type ServiceName

type ServiceName string
const (
	ServiceNameController    ServiceName = "arvados-controller"
	ServiceNameDispatchCloud ServiceName = "arvados-dispatch-cloud"
	ServiceNameDispatchLSF   ServiceName = "arvados-dispatch-lsf"
	ServiceNameDispatchSLURM ServiceName = "crunch-dispatch-slurm"
	ServiceNameGitHTTP       ServiceName = "arvados-git-httpd"
	ServiceNameHealth        ServiceName = "arvados-health"
	ServiceNameKeepbalance   ServiceName = "keep-balance"
	ServiceNameKeepproxy     ServiceName = "keepproxy"
	ServiceNameKeepstore     ServiceName = "keepstore"
	ServiceNameKeepweb       ServiceName = "keep-web"
	ServiceNameRailsAPI      ServiceName = "arvados-api-server"
	ServiceNameWebsocket     ServiceName = "arvados-ws"
	ServiceNameWorkbench1    ServiceName = "arvados-workbench1"
	ServiceNameWorkbench2    ServiceName = "arvados-workbench2"
)

type Services

type Services struct {
	Composer       Service
	Controller     Service
	DispatchCloud  Service
	DispatchLSF    Service
	DispatchSLURM  Service
	GitHTTP        Service
	GitSSH         Service
	Health         Service
	Keepbalance    Service
	Keepproxy      Service
	Keepstore      Service
	RailsAPI       Service
	WebDAVDownload Service
	WebDAV         Service
	WebShell       Service
	Websocket      Service
	Workbench1     Service
	Workbench2     Service
}

func (Services) Map

func (svcs Services) Map() map[ServiceName]Service

Map returns all services as a map, suitable for iterating over all services or looking up a service by name.

type SizedDigest

type SizedDigest string

SizedDigest is a minimal Keep block locator: hash+size

func (SizedDigest) Size

func (sd SizedDigest) Size() int64

Size returns the size of the data block, in bytes.

type Specimen

type Specimen struct {
	UUID                 string                 `json:"uuid"`
	OwnerUUID            string                 `json:"owner_uuid"`
	CreatedAt            time.Time              `json:"created_at"`
	ModifiedAt           time.Time              `json:"modified_at"`
	ModifiedByClientUUID string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID   string                 `json:"modified_by_user_uuid"`
	Properties           map[string]interface{} `json:"properties"`
}

type SpecimenList

type SpecimenList struct {
	Items          []Specimen `json:"items"`
	ItemsAvailable int        `json:"items_available"`
	Offset         int        `json:"offset"`
	Limit          int        `json:"limit"`
}

type StorageClassConfig

type StorageClassConfig struct {
	Default  bool
	Priority int
}

type StringSet

type StringSet map[string]struct{}

func (*StringSet) UnmarshalJSON

func (ss *StringSet) UnmarshalJSON(data []byte) error

UnmarshalJSON handles old config files that provide an array of instance types instead of a hash.

type StubClient

type StubClient struct{}

func (*StubClient) BlockWrite

func (*StubClient) LocalLocator

func (*StubClient) LocalLocator(loc string) (string, error)

func (*StubClient) ReadAt

func (*StubClient) ReadAt(string, []byte, int) (int, error)

func (*StubClient) RequestAndDecode

func (*StubClient) RequestAndDecode(_ interface{}, _, _ string, _ io.Reader, _ interface{}) error

type Subtree

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

A Subtree is a detached part of a filesystem tree that can be spliced into a filesystem via (File)Splice().

func Snapshot

func Snapshot(fs FileSystem, path string) (*Subtree, error)

Snapshot returns a Subtree that's a copy of the given path. It returns an error if the path is not inside a collection.

type TLSVersion

type TLSVersion uint16

func (TLSVersion) MarshalText

func (v TLSVersion) MarshalText() ([]byte, error)

func (*TLSVersion) UnmarshalJSON

func (v *TLSVersion) UnmarshalJSON(text []byte) error

type TestUser

type TestUser struct {
	Email    string
	Password string
}

type Trait

type Trait struct {
	UUID                 string                 `json:"uuid"`
	Etag                 string                 `json:"etag"`
	OwnerUUID            string                 `json:"owner_uuid"`
	CreatedAt            time.Time              `json:"created_at"`
	ModifiedByClientUUID string                 `json:"modified_by_client_uuid"`
	ModifiedByUserUUID   string                 `json:"modified_by_user_uuid"`
	ModifiedAt           time.Time              `json:"modified_at"`
	Name                 string                 `json:"name"`
	Properties           map[string]interface{} `json:"properties"`
	UpdatedAt            time.Time              `json:"updated_at"`
	WritableBy           []string               `json:"writable_by,omitempty"`
}

Trait is an arvados#trait record

type TransactionError

type TransactionError struct {
	Method     string
	URL        url.URL
	StatusCode int
	Status     string
	Errors     []string
}

func (TransactionError) Error

func (e TransactionError) Error() (s string)

func (TransactionError) HTTPStatus

func (e TransactionError) HTTPStatus() int

type URL

type URL url.URL

URL is a url.URL that is also usable as a JSON key/value.

func (URL) MarshalText

func (su URL) MarshalText() ([]byte, error)

func (URL) String

func (su URL) String() string

func (*URL) UnmarshalText

func (su *URL) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler so URL can be used as a JSON key/value.

type UntrashOptions

type UntrashOptions struct {
	UUID             string `json:"uuid"`
	EnsureUniqueName bool   `json:"ensure_unique_name"`
}

type UpdateOptions

type UpdateOptions struct {
	UUID             string                 `json:"uuid"`
	Attrs            map[string]interface{} `json:"attrs"`
	Select           []string               `json:"select"`
	BypassFederation bool                   `json:"bypass_federation"`
	// ReplaceFiles only applies when updating a collection.
	ReplaceFiles map[string]string `json:"replace_files"`
}

type UploadDownloadPermission

type UploadDownloadPermission struct {
	Upload   bool
	Download bool
}

type UploadDownloadRolePermissions

type UploadDownloadRolePermissions struct {
	User  UploadDownloadPermission
	Admin UploadDownloadPermission
}

type User

type User struct {
	UUID                 string                 `json:"uuid"`
	Etag                 string                 `json:"etag"`
	IsActive             bool                   `json:"is_active"`
	IsAdmin              bool                   `json:"is_admin"`
	Username             string                 `json:"username"`
	Email                string                 `json:"email"`
	FullName             string                 `json:"full_name"`
	FirstName            string                 `json:"first_name"`
	LastName             string                 `json:"last_name"`
	IdentityURL          string                 `json:"identity_url"`
	IsInvited            bool                   `json:"is_invited"`
	OwnerUUID            string                 `json:"owner_uuid"`
	CreatedAt            time.Time              `json:"created_at"`
	ModifiedAt           time.Time              `json:"modified_at"`
	ModifiedByUserUUID   string                 `json:"modified_by_user_uuid"`
	ModifiedByClientUUID string                 `json:"modified_by_client_uuid"`
	Prefs                map[string]interface{} `json:"prefs"`
	WritableBy           []string               `json:"writable_by,omitempty"`
	CanWrite             bool                   `json:"can_write"`
	CanManage            bool                   `json:"can_manage"`
}

User is an arvados#user record

type UserActivateOptions

type UserActivateOptions struct {
	UUID string `json:"uuid"`
}

type UserAuthenticateOptions

type UserAuthenticateOptions struct {
	Username string `json:"username,omitempty"` // PAM username
	Password string `json:"password,omitempty"` // PAM password
}

type UserBatchUpdateOptions

type UserBatchUpdateOptions struct {
	Updates map[string]map[string]interface{} `json:"updates"`
}

type UserBatchUpdateResponse

type UserBatchUpdateResponse struct{}

type UserList

type UserList struct {
	Items          []User `json:"items"`
	ItemsAvailable int    `json:"items_available"`
	Offset         int    `json:"offset"`
	Limit          int    `json:"limit"`
}

UserList is an arvados#userList resource.

type UserMergeOptions

type UserMergeOptions struct {
	NewUserUUID       string `json:"new_user_uuid,omitempty"`
	OldUserUUID       string `json:"old_user_uuid,omitempty"`
	NewOwnerUUID      string `json:"new_owner_uuid,omitempty"`
	NewUserToken      string `json:"new_user_token,omitempty"`
	RedirectToNewUser bool   `json:"redirect_to_new_user"`
}

type UserSetupOptions

type UserSetupOptions struct {
	UUID                  string                 `json:"uuid,omitempty"`
	Email                 string                 `json:"email,omitempty"`
	OpenIDPrefix          string                 `json:"openid_prefix,omitempty"`
	RepoName              string                 `json:"repo_name,omitempty"`
	VMUUID                string                 `json:"vm_uuid,omitempty"`
	SendNotificationEmail bool                   `json:"send_notification_email,omitempty"`
	Attrs                 map[string]interface{} `json:"attrs"`
}

type VirtualMachine

type VirtualMachine struct {
	UUID               string     `json:"uuid"`
	OwnerUUID          string     `json:"owner_uuid"`
	Hostname           string     `json:"hostname"`
	CreatedAt          *time.Time `json:"created_at"`
	ModifiedAt         *time.Time `json:"modified_at"`
	ModifiedByUserUUID string     `json:"modified_by_user_uuid"`
}

VirtualMachine is an arvados#virtualMachine resource.

type VirtualMachineList

type VirtualMachineList struct {
	Items          []VirtualMachine `json:"items"`
	ItemsAvailable int              `json:"items_available"`
	Offset         int              `json:"offset"`
	Limit          int              `json:"limit"`
}

VirtualMachineList is an arvados#virtualMachineList resource.

type Vocabulary

type Vocabulary struct {
	StrictTags bool                     `json:"strict_tags"`
	Tags       map[string]VocabularyTag `json:"tags"`
	// contains filtered or unexported fields
}

func NewVocabulary

func NewVocabulary(data []byte, managedTagKeys []string) (voc *Vocabulary, err error)

NewVocabulary creates a new Vocabulary from a JSON definition and a list of reserved tag keys that will get special treatment when strict mode is enabled.

func (*Vocabulary) Check

func (v *Vocabulary) Check(data map[string]interface{}) error

Check validates the given data against the vocabulary.

type VocabularyLabel

type VocabularyLabel struct {
	Label string `json:"label"`
}

type VocabularyTag

type VocabularyTag struct {
	Strict bool                          `json:"strict"`
	Labels []VocabularyLabel             `json:"labels"`
	Values map[string]VocabularyTagValue `json:"values"`
}

type VocabularyTagValue

type VocabularyTagValue struct {
	Labels []VocabularyLabel `json:"labels"`
}

type Volume

type Volume struct {
	AccessViaHosts         map[URL]VolumeAccess
	ReadOnly               bool
	AllowTrashWhenReadOnly bool
	Replication            int
	StorageClasses         map[string]bool
	Driver                 string
	DriverParameters       json.RawMessage
}

type VolumeAccess

type VolumeAccess struct {
	ReadOnly bool
}

type WebDAVCacheConfig

type WebDAVCacheConfig struct {
	TTL                Duration
	DiskCacheSize      ByteSizeOrPercent
	MaxCollectionBytes ByteSize
	MaxSessions        int
}

type WebDAVOptions

type WebDAVOptions struct {
	Method string
	Path   string
	Header http.Header
}

type Workflow

type Workflow struct {
	UUID        string     `json:"uuid"`
	OwnerUUID   string     `json:"owner_uuid"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Definition  string     `json:"definition"`
	CreatedAt   *time.Time `json:"created_at"`
	ModifiedAt  *time.Time `json:"modified_at"`
}

Workflow is an arvados#workflow resource.

type WorkflowList

type WorkflowList struct {
	Items          []Workflow `json:"items"`
	ItemsAvailable int        `json:"items_available"`
	Offset         int        `json:"offset"`
	Limit          int        `json:"limit"`
}

WorkflowList is an arvados#workflowList resource.

Jump to

Keyboard shortcuts

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