X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/64e387b2f4f0fe6c4c7bf16232706c7cf194caf0..9a71dd94cb72a5fd1ed74ca71b4961de4108db02:/sdk/go/arvados/api.go diff --git a/sdk/go/arvados/api.go b/sdk/go/arvados/api.go index aa670c5392..c32f88864f 100644 --- a/sdk/go/arvados/api.go +++ b/sdk/go/arvados/api.go @@ -19,6 +19,7 @@ type APIEndpoint struct { var ( EndpointConfigGet = APIEndpoint{"GET", "arvados/v1/config", ""} EndpointLogin = APIEndpoint{"GET", "login", ""} + EndpointLogout = APIEndpoint{"GET", "logout", ""} EndpointCollectionCreate = APIEndpoint{"POST", "arvados/v1/collections", "collection"} EndpointCollectionUpdate = APIEndpoint{"PATCH", "arvados/v1/collections/{uuid}", "collection"} EndpointCollectionGet = APIEndpoint{"GET", "arvados/v1/collections/{uuid}", ""} @@ -54,15 +55,17 @@ var ( 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", ""} + EndpointUserBatchUpdate = APIEndpoint{"PATCH", "arvados/v1/users/batch_update", ""} + EndpointUserAuthenticate = APIEndpoint{"POST", "arvados/v1/users/authenticate", ""} EndpointAPIClientAuthorizationCurrent = APIEndpoint{"GET", "arvados/v1/api_client_authorizations/current", ""} ) type GetOptions struct { - UUID string `json:"uuid"` + UUID string `json:"uuid,omitempty"` Select []string `json:"select"` IncludeTrash bool `json:"include_trash"` - ForwardedFor string `json:"forwarded_for"` + ForwardedFor string `json:"forwarded_for,omitempty"` + Remote string `json:"remote,omitempty"` } type UntrashOptions struct { @@ -75,13 +78,14 @@ type ListOptions struct { Select []string `json:"select"` Filters []Filter `json:"filters"` Where map[string]interface{} `json:"where"` - Limit int `json:"limit"` - Offset int `json:"offset"` + 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"` } type CreateOptions struct { @@ -92,8 +96,9 @@ type CreateOptions struct { } type UpdateOptions struct { - UUID string `json:"uuid"` - Attrs map[string]interface{} `json:"attrs"` + UUID string `json:"uuid"` + Attrs map[string]interface{} `json:"attrs"` + BypassFederation bool `json:"bypass_federation"` } type UpdateUUIDOptions struct { @@ -140,9 +145,19 @@ type LoginOptions struct { State string `json:"state,omitempty"` // OAuth2 callback state } +type UserAuthenticateOptions struct { + Username string `json:"username,omitempty"` // PAM username + Password string `json:"password,omitempty"` // PAM password +} + +type LogoutOptions struct { + ReturnTo string `json:"return_to"` // Redirect to this URL after logging out +} + type API interface { ConfigGet(ctx context.Context) (json.RawMessage, 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) CollectionUpdate(ctx context.Context, options UpdateOptions) (Collection, error) CollectionGet(ctx context.Context, options GetOptions) (Collection, error) @@ -177,5 +192,6 @@ type API interface { 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) }