X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d8d6bca4b5db4851a29473f08dc600816c977a21..79870ba994f0606c8ed13806f00cb8b23d9b2c83:/sdk/go/arvados/api.go diff --git a/sdk/go/arvados/api.go b/sdk/go/arvados/api.go index bcb51d6b2e..0fdc13d198 100644 --- a/sdk/go/arvados/api.go +++ b/sdk/go/arvados/api.go @@ -8,6 +8,7 @@ import ( "bufio" "context" "encoding/json" + "io" "net" "github.com/sirupsen/logrus" @@ -22,6 +23,7 @@ type APIEndpoint struct { var ( EndpointConfigGet = APIEndpoint{"GET", "arvados/v1/config", ""} + EndpointVocabularyGet = APIEndpoint{"GET", "arvados/v1/vocabulary", ""} EndpointLogin = APIEndpoint{"GET", "login", ""} EndpointLogout = APIEndpoint{"GET", "logout", ""} EndpointCollectionCreate = APIEndpoint{"POST", "arvados/v1/collections", "collection"} @@ -59,7 +61,13 @@ var ( 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}", ""} EndpointUserActivate = APIEndpoint{"POST", "arvados/v1/users/{uuid}/activate", ""} EndpointUserCreate = APIEndpoint{"POST", "arvados/v1/users", "user"} EndpointUserCurrent = APIEndpoint{"GET", "arvados/v1/users/current", ""} @@ -73,7 +81,6 @@ var ( EndpointUserSystem = APIEndpoint{"GET", "arvados/v1/users/system", ""} EndpointUserUnsetup = APIEndpoint{"POST", "arvados/v1/users/{uuid}/unsetup", ""} EndpointUserUpdate = APIEndpoint{"PATCH", "arvados/v1/users/{uuid}", "user"} - EndpointUserUpdateUUID = APIEndpoint{"POST", "arvados/v1/users/{uuid}/update_uuid", ""} EndpointUserBatchUpdate = APIEndpoint{"PATCH", "arvados/v1/users/batch_update", ""} EndpointUserAuthenticate = APIEndpoint{"POST", "arvados/v1/users/authenticate", ""} EndpointAPIClientAuthorizationCurrent = APIEndpoint{"GET", "arvados/v1/api_client_authorizations/current", ""} @@ -131,26 +138,27 @@ type CreateOptions struct { type UpdateOptions struct { UUID string `json:"uuid"` Attrs map[string]interface{} `json:"attrs"` + Select []string `json:"select"` BypassFederation bool `json:"bypass_federation"` } 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 UpdateUUIDOptions struct { - UUID string `json:"uuid"` - NewUUID string `json:"new_uuid"` -} - type UserActivateOptions struct { UUID string `json:"uuid"` } @@ -199,8 +207,25 @@ type LogoutOptions struct { ReturnTo string `json:"return_to"` // Redirect to this URL after logging out } +type BlockWriteOptions struct { + Hash string + Data []byte + Reader io.Reader + DataSize int // Must be set if Data is nil. + RequestID string + StorageClasses []string + Replicas int + Attempts int +} + +type BlockWriteResponse struct { + Locator string + Replicas int +} + 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) CollectionCreate(ctx context.Context, options CreateOptions) (Collection, error) @@ -232,7 +257,13 @@ type API interface { 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) SpecimenCreate(ctx context.Context, options CreateOptions) (Specimen, error) SpecimenUpdate(ctx context.Context, options UpdateOptions) (Specimen, error) SpecimenGet(ctx context.Context, options GetOptions) (Specimen, error) @@ -240,7 +271,6 @@ type API interface { SpecimenDelete(ctx context.Context, options DeleteOptions) (Specimen, error) UserCreate(ctx context.Context, options CreateOptions) (User, error) UserUpdate(ctx context.Context, options UpdateOptions) (User, error) - UserUpdateUUID(ctx context.Context, options UpdateUUIDOptions) (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)