api

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: AGPL-3.0 Imports: 35 Imported by: 0

Documentation

Overview

Copyright © 2020 Yale University

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var EfsAdminPolicy = iam.PolicyDocument{
	Version: "2012-10-17",
	Statement: []iam.StatementEntry{
		{
			Sid:    "AllowActionsOnVolumesInSpaceAndOrg",
			Effect: "Allow",
			Action: []string{
				"elasticfilesystem:ClientRootAccess",
				"elasticfilesystem:ClientWrite",
				"elasticfilesystem:ClientMount",
			},
			Resource: []string{"*"},
			Condition: iam.Condition{
				"StringEqualsIgnoreCase": iam.ConditionStatement{
					"aws:ResourceTag/Name":           []string{"${aws:PrincipalTag/ResourceName}"},
					"aws:ResourceTag/spinup:org":     []string{"${aws:PrincipalTag/spinup:org}"},
					"aws:ResourceTag/spinup:spaceid": []string{"${aws:PrincipalTag/spinup:spaceid}"},
				},
			},
		},
	},
}

Functions

func NewServer

func NewServer(config common.Config) error

NewServer creates a new server and starts it

func TokenMiddleware

func TokenMiddleware(psk []byte, public map[string]string, h http.Handler) http.Handler

TokenMiddleware checks the tokens for non-public URLs

Types

type AccessPoint

type AccessPoint struct {
	// The unique Amazon Resource Name (ARN) associated with the access point.
	AccessPointArn string

	// The ID of the access point, assigned by Amazon EFS.
	AccessPointId string

	// Identifies the lifecycle phase of the access point.
	LifeCycleState string

	// The name of the access point. This is the value of the Name tag.
	Name string

	// The full POSIX identity, including the user ID, group ID, and secondary group
	// IDs on the access point that is used for all file operations by NFS clients
	// using the access point.
	PosixUser *efs.PosixUser

	// The directory on the Amazon EFS file system that the access point exposes
	// as the root directory to NFS clients using the access point.
	RootDirectory *efs.RootDirectory
}

type AccessPointCreateRequest added in v0.9.0

AccessPointCreateRequest is the input for creating an access point

type FileSystemAccessPolicy added in v0.12.0

type FileSystemAccessPolicy struct {
	AllowAnonymousAccess      bool
	EnforceEncryptedTransport bool
	AllowEcsTaskExecutionRole bool
}

FileSystemAccessPolicy is a set of flags to control access to the filesystem

type FileSystemCreateRequest

type FileSystemCreateRequest struct {
	// Name of the filesystem
	Name string

	// AccessPoints is an optional list of access points to create
	AccessPoints []*AccessPointCreateRequest

	// AccessPolicy is a set of flags to control access to the filesystem
	AccessPolicy *FileSystemAccessPolicy

	// BackupPolicy is the backup policy/status for the filesystem
	// Valid values are ENABLED | DISABLED
	BackupPolicy string

	// KMSKeyId used to encrypt the filesystem
	KmsKeyId string

	// After how long to transition to Infrequent Access storage
	// Valid values: NONE | AFTER_7_DAYS | AFTER_14_DAYS | AFTER_30_DAYS | AFTER_60_DAYS | AFTER_90_DAYS
	LifeCycleConfiguration string

	// Rule for transitioning back to the primary storage class from IA
	// Valid values: NONE | AFTER_1_ACCESS
	TransitionToPrimaryStorageClass string

	// OneZone creates the filesystem using the EFS OneZone storage classes
	OneZone bool

	// Security Group IDs to apply to the mount targets
	Sgs []string

	// subnets holds the list of subnets for one zone, not exposed to the client
	Subnets []string

	// Tags to apply to the filesystem
	Tags []*Tag
}

FileSystemCreateRequest is the request input for creating a filesystem

type FileSystemResponse

type FileSystemResponse struct {
	// list of access points associated with the filesystem
	AccessPoints []*AccessPoint

	// AccessPolicy is a set of flags to control access to the filesystem
	AccessPolicy *FileSystemAccessPolicy

	// availability zone the filesystem is using
	AvailabilityZone string

	// BackupPolicy is the backup policy/status for the filesystem
	// Valid values are ENABLED | ENABLING | DISABLED | DISABLING
	BackupPolicy string

	// The time that the file system was created, in seconds (since 1970-01-01T00:00:00Z).
	CreationTime time.Time

	// The Amazon Resource Name (ARN) for the EFS file system, in the format arn:aws:elasticfilesystem:region:account-id:file-system/file-system-id
	FileSystemArn string

	// The ID of the file system, assigned by Amazon EFS.
	FileSystemId string

	// The ID of an KMS master key (CMK) used to encrypt the file system.
	KmsKeyId string

	// The lifecycle phase of the file system.
	LifeCycleState string

	// The lifecycle transition policy.
	// Valid values: NONE | AFTER_7_DAYS | AFTER_14_DAYS | AFTER_30_DAYS | AFTER_60_DAYS | AFTER_90_DAYS
	LifeCycleConfiguration string

	// Rule for transitioning back to the primary storage class from IA
	// Valid values: NONE | AFTER_1_ACCESS
	TransitionToPrimaryStorageClass string

	// A list of mount targets associated with the filesystem.
	MountTargets []*MountTarget

	// The name of the filesystem.
	Name string

	// The current number of access points that the file system has.
	NumberOfAccessPoints int64

	// The current number of mount targets that the file system has.
	NumberOfMountTargets int64

	// If true, the filesystem is using the EFS OneZone storage classes
	OneZone bool

	// The latest known metered size (in bytes) of data stored in the file system,
	// in its Value field, and the time at which that size was determined in its
	// Timestamp field. The Timestamp value is the integer number of seconds since
	// 1970-01-01T00:00:00Z. The SizeInBytes value doesn't represent the size of
	// a consistent snapshot of the file system, but it is eventually consistent
	// when there are no writes to the file system. That is, SizeInBytes represents
	// actual size only if the file system is not modified for a period longer than
	// a couple of hours. Otherwise, the value is not the exact size that the file
	// system was at any point in time.
	SizeInBytes *FileSystemSize

	// The tags associated with the file system.
	Tags []*Tag
}

FileSystemResponse represents a full filesystem service response

A filesystem can have zero or more mount targets and zero or more access points.

type FileSystemSize

type FileSystemSize struct {
	// The time at which the size of data, returned in the Value field, was determined.
	// The value is the integer number of seconds since 1970-01-01T00:00:00Z.
	Timestamp time.Time

	// The latest known metered size (in bytes) of data stored in the file system.
	//
	// Value is a required field
	Value int64

	// The latest known metered size (in bytes) of data stored in the Infrequent
	// Access storage class.
	ValueInIA int64

	// The latest known metered size (in bytes) of data stored in the Standard storage
	// class.
	ValueInStandard int64
}

type FileSystemUpdateRequest added in v0.5.0

type FileSystemUpdateRequest struct {
	// AccessPolicy is a set of flags to control access to the filesystem
	AccessPolicy *FileSystemAccessPolicy

	// BackupPolicy is the backup policy/status for the filesystem
	// Valid values are ENABLED | DISABLED
	BackupPolicy string

	// After how long to transition to Infrequent Access storage
	// Valid values: NONE | AFTER_7_DAYS | AFTER_14_DAYS | AFTER_30_DAYS | AFTER_60_DAYS | AFTER_90_DAYS
	LifeCycleConfiguration string

	// Rule for transitioning back to the primary storage class from IA
	// Valid values: NONE | AFTER_1_ACCESS
	TransitionToPrimaryStorageClass string

	// Tags to apply to the filesystem
	Tags []*Tag
}

FileSystemUpdateRequest is the input for updating a filesystem

type FileSystemUserCreateRequest added in v0.11.0

type FileSystemUserCreateRequest struct {
	UserName string
}

FileSystemUserCreateRequest is the request payload for creating a filsystem user

type FileSystemUserResponse added in v0.11.0

type FileSystemUserResponse struct {
	UserName          string
	AccessKeys        []*iam.AccessKeyMetadata `json:",omitempty"`
	AccessKey         *iam.AccessKey           `json:",omitempty"`
	DeletedAccessKeys []string                 `json:",omitempty"`
	Groups            []string                 `json:",omitempty"`
	Tags              []*Tag                   `json:",omitempty"`
}

FileSystemUserResponse is the response payload for user operations

type FileSystemUserUpdateRequest added in v0.11.0

type FileSystemUserUpdateRequest struct {
	ResetKey bool
}

FileSystemUserUpdateRequest is the request payload for updating a user

type LogWriter

type LogWriter struct {
	http.ResponseWriter
}

LogWriter is an http.ResponseWriter

func (LogWriter) Write

func (w LogWriter) Write(p []byte) (n int, err error)

Write log message if http response writer returns an error

type MountTarget

type MountTarget struct {
	// The unique and consistent identifier of the Availability Zone (AZ) that the
	// mount target resides in. For example, use1-az1 is an AZ ID for the us-east-1
	// Region and it has the same location in every AWS account.
	AvailabilityZoneId string

	// The name of the Availability Zone (AZ) that the mount target resides in.
	// AZs are independently mapped to names for each AWS account. For example,
	// the Availability Zone us-east-1a for your AWS account might not be the same
	// location as us-east-1a for another AWS account.
	AvailabilityZoneName string

	// Address at which the file system can be mounted by using the mount target.
	IpAddress string

	// Lifecycle state of the mount target.
	//
	// LifeCycleState is a required field
	LifeCycleState string

	// System-assigned mount target ID.
	//
	// MountTargetId is a required field
	MountTargetId string

	// The ID of the mount target's subnet.
	//
	// SubnetId is a required field
	SubnetId string
}

type Tag

type Tag struct {
	Key   string
	Value string
}

Tag is an API tag

Jump to

Keyboard shortcuts

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