globus

package module
v0.0.0-...-e8ff168 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 9 Imported by: 1

README

goglobus

Globus API in Go

Documentation

Index

Constants

View Source
const ACLPrincipalTypeAllAuthenticatedUsers = "all_authenticated_users"
View Source
const ACLPrincipalTypeIdentity = "identity"

Variables

View Source
var ErrGlobusAuth = errors.New("globus auth")

Functions

This section is empty.

Types

type APIClient

type APIClient interface {
	Authenticate() error
	GetEndpointTaskList(endpointID string, filters map[string]string) (TaskList, error)
	GetTaskSuccessfulTransfers(taskID string, marker int) (TransferItems, error)
	GetIdentities(users []string) (Identities, error)
	AddEndpointACLRule(rule EndpointACLRule) (AddEndpointACLRuleResult, error)
	DeleteEndpointACLRule(endpointID string, accessID int) (DeleteEndpointACLRuleResult, error)
}

type APIParams

type APIParams struct {
	GlobusEndpointID string
	GlobusCCUser     string
	GlobusCCToken    string
}

func GetAPIParamsFromEnvFatal

func GetAPIParamsFromEnvFatal() APIParams

type AccessRule

type AccessRule struct {
	DataType      string `json:"DATA_TYPE"`
	PrincipalType string `json:"principal_type"`
	Path          string `json:"path"`
	Principal     string `json:"principal"`
	AccessID      string `json:"id"`
	Permissions   string `json:"permissions"`
}

type AddEndpointACLRuleResult

type AddEndpointACLRuleResult struct {
	Code      string `json:"code"`
	Resource  string `json:"resource"`
	DataType  string `json:"DATA_TYPE"`
	RequestID string `json:"request_id"`
	AccessID  string `json:"access_id"`
	Message   string `json:"message"`
}

type Client

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

func CreateConfidentialClient

func CreateConfidentialClient(ccUser, ccPassword string) (*Client, error)

func (*Client) AddEndpointACLRule

func (c *Client) AddEndpointACLRule(rule EndpointACLRule) (AddEndpointACLRuleResult, error)

func (*Client) Authenticate

func (c *Client) Authenticate() error

Authenticate will authentice with Globus and get a token to use in subsequent calls.

func (*Client) DeleteEndpointACLRule

func (c *Client) DeleteEndpointACLRule(endpointID string, accessID string) (DeleteEndpointACLRuleResult, error)

func (*Client) GetEndpointAccessRules

func (c *Client) GetEndpointAccessRules(endpointID string) (EndpointAccessRuleList, error)

func (*Client) GetEndpointTaskList

func (c *Client) GetEndpointTaskList(endpointID string, filters map[string]string) (TaskList, error)

func (*Client) GetGlobusErrorResponse

func (c *Client) GetGlobusErrorResponse() *ErrorResponse

func (*Client) GetIdentities

func (c *Client) GetIdentities(users []string) (Identities, error)

func (*Client) GetTaskSuccessfulTransfers

func (c *Client) GetTaskSuccessfulTransfers(taskID string, marker int) (TransferItems, error)

type DeleteEndpointACLRuleResult

type DeleteEndpointACLRuleResult struct {
	Code      string `json:"code"`
	DataType  string `json:"DATA_TYPE"`
	Resource  string `json:"resource"`
	RequestID string `json:"request_id"`
	Message   string `json:"message"`
}

type EndpointACLRule

type EndpointACLRule struct {
	PrincipalType string
	EndpointID    string
	Path          string
	IdentityID    string
	Permissions   string
}

type EndpointAccessRuleList

type EndpointAccessRuleList struct {
	Length      int          `json:"length"`
	Endpoint    string       `json:"endpoint"`
	AccessRules []AccessRule `json:"DATA"`
	DataType    string       `json:"DATA_TYPE"`
}

type ErrorResponse

type ErrorResponse struct {
	Code      string `json:"code"`
	Message   string `json:"message"`
	RequestID string `json:"request_id"`
	Resource  string `json:"resource"`
}

ErrorResponse describes the JSON that Globus responds with when there is an error in an API call

func ToErrorFromResponse

func ToErrorFromResponse(resp *resty.Response) (*ErrorResponse, error)

type Identities

type Identities struct {
	Identities []Identity `json:"identities"`
}

type Identity

type Identity struct {
	Username         string `json:"username"`
	Status           string `json:"status"`
	Name             string `json:"name"`
	ID               string `json:"id"`
	IdentityProvider string `json:"identity_provider"`
	Organizaion      string `json:"organizaton"`
	EMail            string `json:"email"`
}

type IdentityProvider

type IdentityProvider struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type IncludedProviders

type IncludedProviders struct {
	IdentityProviders []IdentityProvider `json:"identity_providers"`
	Identities        []Identity         `json:"identities"`
}

type MockClient

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

func NewMockClient

func NewMockClient(err error) *MockClient

func (*MockClient) AddEndpointACLRule

func (c *MockClient) AddEndpointACLRule(rule EndpointACLRule) (AddEndpointACLRuleResult, error)

func (*MockClient) Authenticate

func (c *MockClient) Authenticate() error

func (*MockClient) DeleteEndpointACLRule

func (c *MockClient) DeleteEndpointACLRule(endpointID string, accessID int) (DeleteEndpointACLRuleResult, error)

func (*MockClient) Err

func (c *MockClient) Err(err error) *MockClient

func (*MockClient) GetEndpointTaskList

func (c *MockClient) GetEndpointTaskList(endpointID string, filters map[string]string) (TaskList, error)

func (*MockClient) GetIdentities

func (c *MockClient) GetIdentities(users []string) (Identities, error)

func (*MockClient) GetTaskSuccessfulTransfers

func (c *MockClient) GetTaskSuccessfulTransfers(taskID string, marker int) (TransferItems, error)

type Task

type Task struct {
	DataType                   string `json:"DATA_TYPE"`
	TaskID                     string `json:"task_id"`
	Type                       string `json:"type"`
	Status                     string `json:"status"`
	Label                      string `json:"label"`
	OwnerID                    string `json:"owner_id"`
	RequestTime                string `json:"request_time"`
	CompletionTime             string `json:"completion_time"`
	Deadline                   string `json:"deadline"`
	SyncLevel                  int    `json:"sync_level"`
	EncryptData                bool   `json:"encrypt_data"`
	VerifyChecksum             bool   `json:"verify_checksum"`
	DeleteDestinationExtra     bool   `json:"delete_destination_extra"`
	RecursiveSymlinks          string `json:"recursive_symlinks"`
	PreserveTimestamp          bool   `json:"preserve_timestamp"`
	Command                    string `json:"command"`
	HistoryDeleted             bool   `json:"history_deleted"`
	Faults                     int    `json:"faults"`
	FilesCount                 int    `json:"files"`
	DirectoriesCount           int    `json:"directories"`
	SymlinksCount              int    `json:"symlinks"`
	FilesSkipped               int    `json:"files_skipped"`
	FilesTransferred           int    `json:"files_transferred"`
	SubtasksTotal              int    `json:"subtasks_total"`
	SubtasksPending            int    `json:"subtasks_pending"`
	SubtasksRetrying           int    `json:"subtasks_retrying"`
	SubtasksSucceeded          int    `json:"subtasks_succeeded"`
	SubtasksFailed             int    `json:"subtasks_failed"`
	BytesTransferred           int    `json:"bytes_transferred"`
	BytesChecksummed           int    `json:"bytes_checksummed"`
	EffectiveBytesPerSecond    int    `json:"effective_bytes_per_second"`
	NiceStatus                 string `json:"nice_status"`
	NiceStatusShortDescription string `json:"nice_status_short_description"`
	NiceStatusExpiresIn        string `json:"nice_status_expires_in"`
	CanceledByAdmin            string `json:"canceled_by_admin"`
	CanceledByAdminMessage     string `json:"canceled_by_admin_message"`
	IsPaused                   bool   `json:"is_paused"`
	TaskExtras
}

type TaskExtras

type TaskExtras struct {
	SourceEndpoint                     string `json:"source_endpoint"`
	SourceEndpointID                   string `json:"source_endpoint_id"`
	SourceEndpointDisplayName          string `json:"source_endpoint_display_name"`
	DestinationEndpoint                string `json:"destination_endpoint"`
	DestinationEndpointID              string `json:"destination_endpoint_id"`
	DestinationEndpointDisplayName     string `json:"destination_endpoint_display_name"`
	SourceHostEndpoint                 string `json:"source_host_endpoint"`
	SourceHostEndpointID               string `json:"source_host_endpoint_id"`
	SourceHostEndpointDisplayName      string `json:"source_host_endpoint_display_name"`
	DestinationHostEndpoint            string `json:"destination_host_endpoint"`
	DestinationHostEndpointID          string `json:"destination_host_endpoint_id"`
	DestinationHostEndpointDisplayName string `json:"destination_host_endpoint_display_name"`
	SourceHostPath                     string `json:"source_host_path"`
	DestinationHostPath                string `json:"destination_host_path"`
	IsOK                               bool   `json:"is_ok"`
	SourceLocalUser                    string `json:"source_local_user"`
	SourceLocalUserStatus              string `json:"source_local_user_status"`
	DestinationLocalUser               string `json:"destination_local_user"`
	DestinationLocalUserStatus         string `json:"destination_local_user_status"`
	OwnerString                        string `json:"owner_string"`
}

type TaskList

type TaskList struct {
	DataType    string `json:"DATA_TYPE"`
	Limit       int    `json:"limit"`
	LastKey     string `json:"last_key"`
	HasNextPage bool   `json:"has_next_page"`
	Tasks       []Task `json:"DATA"`
}

type Transfer

type Transfer struct {
	DataType        string `json:"DATA_TYPE"`
	SourcePath      string `json:"source_path"`
	DestinationPath string `json:"destination_path"`
}

type TransferItems

type TransferItems struct {
	DataType   string     `json:"DATA_TYPE"`
	Marker     int        `json:"marker"`
	NextMarker int        `json:"next_marker"`
	Transfers  []Transfer `json:"DATA"`
}

Jump to

Keyboard shortcuts

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