1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
12 type APIEndpoint struct {
15 // "new attributes" key for create/update requests
20 EndpointConfigGet = APIEndpoint{"GET", "arvados/v1/config", ""}
21 EndpointLogin = APIEndpoint{"GET", "login", ""}
22 EndpointCollectionCreate = APIEndpoint{"POST", "arvados/v1/collections", "collection"}
23 EndpointCollectionUpdate = APIEndpoint{"PATCH", "arvados/v1/collections/{uuid}", "collection"}
24 EndpointCollectionGet = APIEndpoint{"GET", "arvados/v1/collections/{uuid}", ""}
25 EndpointCollectionList = APIEndpoint{"GET", "arvados/v1/collections", ""}
26 EndpointCollectionProvenance = APIEndpoint{"GET", "arvados/v1/collections/{uuid}/provenance", ""}
27 EndpointCollectionUsedBy = APIEndpoint{"GET", "arvados/v1/collections/{uuid}/used_by", ""}
28 EndpointCollectionDelete = APIEndpoint{"DELETE", "arvados/v1/collections/{uuid}", ""}
29 EndpointCollectionTrash = APIEndpoint{"POST", "arvados/v1/collections/{uuid}/trash", ""}
30 EndpointCollectionUntrash = APIEndpoint{"POST", "arvados/v1/collections/{uuid}/untrash", ""}
31 EndpointSpecimenCreate = APIEndpoint{"POST", "arvados/v1/specimens", "specimen"}
32 EndpointSpecimenUpdate = APIEndpoint{"PATCH", "arvados/v1/specimens/{uuid}", "specimen"}
33 EndpointSpecimenGet = APIEndpoint{"GET", "arvados/v1/specimens/{uuid}", ""}
34 EndpointSpecimenList = APIEndpoint{"GET", "arvados/v1/specimens", ""}
35 EndpointSpecimenDelete = APIEndpoint{"DELETE", "arvados/v1/specimens/{uuid}", ""}
36 EndpointContainerCreate = APIEndpoint{"POST", "arvados/v1/containers", "container"}
37 EndpointContainerUpdate = APIEndpoint{"PATCH", "arvados/v1/containers/{uuid}", "container"}
38 EndpointContainerGet = APIEndpoint{"GET", "arvados/v1/containers/{uuid}", ""}
39 EndpointContainerList = APIEndpoint{"GET", "arvados/v1/containers", ""}
40 EndpointContainerDelete = APIEndpoint{"DELETE", "arvados/v1/containers/{uuid}", ""}
41 EndpointContainerLock = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/lock", ""}
42 EndpointContainerUnlock = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/unlock", ""}
43 EndpointUserActivate = APIEndpoint{"POST", "arvados/v1/users/{uuid}/activate", ""}
44 EndpointUserCreate = APIEndpoint{"POST", "arvados/v1/users", "user"}
45 EndpointUserCurrent = APIEndpoint{"GET", "arvados/v1/users/current", ""}
46 EndpointUserDelete = APIEndpoint{"DELETE", "arvados/v1/users/{uuid}", ""}
47 EndpointUserGet = APIEndpoint{"GET", "arvados/v1/users/{uuid}", ""}
48 EndpointUserGetCurrent = APIEndpoint{"GET", "arvados/v1/users/current", ""}
49 EndpointUserGetSystem = APIEndpoint{"GET", "arvados/v1/users/system", ""}
50 EndpointUserList = APIEndpoint{"GET", "arvados/v1/users", ""}
51 EndpointUserMerge = APIEndpoint{"POST", "arvados/v1/users/merge", ""}
52 EndpointUserSetup = APIEndpoint{"POST", "arvados/v1/users/setup", "user"}
53 EndpointUserSystem = APIEndpoint{"GET", "arvados/v1/users/system", ""}
54 EndpointUserUnsetup = APIEndpoint{"POST", "arvados/v1/users/{uuid}/unsetup", ""}
55 EndpointUserUpdate = APIEndpoint{"PATCH", "arvados/v1/users/{uuid}", "user"}
56 EndpointUserUpdateUUID = APIEndpoint{"POST", "arvados/v1/users/{uuid}/update_uuid", ""}
57 EndpointUserBatchUpdate = APIEndpoint{"PATCH", "arvados/v1/users/batch", ""}
58 EndpointAPIClientAuthorizationCurrent = APIEndpoint{"GET", "arvados/v1/api_client_authorizations/current", ""}
61 type GetOptions struct {
62 UUID string `json:"uuid"`
63 Select []string `json:"select"`
64 IncludeTrash bool `json:"include_trash"`
65 ForwardedFor string `json:"forwarded_for"`
66 Remote string `json:"remote"`
69 type UntrashOptions struct {
70 UUID string `json:"uuid"`
71 EnsureUniqueName bool `json:"ensure_unique_name"`
74 type ListOptions struct {
75 ClusterID string `json:"cluster_id"`
76 Select []string `json:"select"`
77 Filters []Filter `json:"filters"`
78 Where map[string]interface{} `json:"where"`
79 Limit int `json:"limit"`
80 Offset int `json:"offset"`
81 Order []string `json:"order"`
82 Distinct bool `json:"distinct"`
83 Count string `json:"count"`
84 IncludeTrash bool `json:"include_trash"`
85 IncludeOldVersions bool `json:"include_old_versions"`
88 type CreateOptions struct {
89 ClusterID string `json:"cluster_id"`
90 EnsureUniqueName bool `json:"ensure_unique_name"`
91 Select []string `json:"select"`
92 Attrs map[string]interface{} `json:"attrs"`
95 type UpdateOptions struct {
96 UUID string `json:"uuid"`
97 Attrs map[string]interface{} `json:"attrs"`
100 type UpdateUUIDOptions struct {
101 UUID string `json:"uuid"`
102 NewUUID string `json:"new_uuid"`
105 type UserActivateOptions struct {
106 UUID string `json:"uuid"`
109 type UserSetupOptions struct {
110 UUID string `json:"uuid,omitempty"`
111 Email string `json:"email,omitempty"`
112 OpenIDPrefix string `json:"openid_prefix,omitempty"`
113 RepoName string `json:"repo_name,omitempty"`
114 VMUUID string `json:"vm_uuid,omitempty"`
115 SendNotificationEmail bool `json:"send_notification_email,omitempty"`
116 Attrs map[string]interface{} `json:"attrs"`
119 type UserMergeOptions struct {
120 NewUserUUID string `json:"new_user_uuid,omitempty"`
121 OldUserUUID string `json:"old_user_uuid,omitempty"`
122 NewOwnerUUID string `json:"new_owner_uuid,omitempty"`
123 NewUserToken string `json:"new_user_token,omitempty"`
124 RedirectToNewUser bool `json:"redirect_to_new_user"`
127 type UserBatchUpdateOptions struct {
128 Updates map[string]map[string]interface{} `json:"updates"`
131 type UserBatchUpdateResponse struct{}
133 type DeleteOptions struct {
134 UUID string `json:"uuid"`
137 type LoginOptions struct {
138 ReturnTo string `json:"return_to"` // On success, redirect to this target with api_token=xxx query param
139 Remote string `json:"remote,omitempty"` // Salt token for remote Cluster ID
140 Code string `json:"code,omitempty"` // OAuth2 callback code
141 State string `json:"state,omitempty"` // OAuth2 callback state
145 ConfigGet(ctx context.Context) (json.RawMessage, error)
146 Login(ctx context.Context, options LoginOptions) (LoginResponse, error)
147 CollectionCreate(ctx context.Context, options CreateOptions) (Collection, error)
148 CollectionUpdate(ctx context.Context, options UpdateOptions) (Collection, error)
149 CollectionGet(ctx context.Context, options GetOptions) (Collection, error)
150 CollectionList(ctx context.Context, options ListOptions) (CollectionList, error)
151 CollectionProvenance(ctx context.Context, options GetOptions) (map[string]interface{}, error)
152 CollectionUsedBy(ctx context.Context, options GetOptions) (map[string]interface{}, error)
153 CollectionDelete(ctx context.Context, options DeleteOptions) (Collection, error)
154 CollectionTrash(ctx context.Context, options DeleteOptions) (Collection, error)
155 CollectionUntrash(ctx context.Context, options UntrashOptions) (Collection, error)
156 ContainerCreate(ctx context.Context, options CreateOptions) (Container, error)
157 ContainerUpdate(ctx context.Context, options UpdateOptions) (Container, error)
158 ContainerGet(ctx context.Context, options GetOptions) (Container, error)
159 ContainerList(ctx context.Context, options ListOptions) (ContainerList, error)
160 ContainerDelete(ctx context.Context, options DeleteOptions) (Container, error)
161 ContainerLock(ctx context.Context, options GetOptions) (Container, error)
162 ContainerUnlock(ctx context.Context, options GetOptions) (Container, error)
163 SpecimenCreate(ctx context.Context, options CreateOptions) (Specimen, error)
164 SpecimenUpdate(ctx context.Context, options UpdateOptions) (Specimen, error)
165 SpecimenGet(ctx context.Context, options GetOptions) (Specimen, error)
166 SpecimenList(ctx context.Context, options ListOptions) (SpecimenList, error)
167 SpecimenDelete(ctx context.Context, options DeleteOptions) (Specimen, error)
168 UserCreate(ctx context.Context, options CreateOptions) (User, error)
169 UserUpdate(ctx context.Context, options UpdateOptions) (User, error)
170 UserUpdateUUID(ctx context.Context, options UpdateUUIDOptions) (User, error)
171 UserMerge(ctx context.Context, options UserMergeOptions) (User, error)
172 UserActivate(ctx context.Context, options UserActivateOptions) (User, error)
173 UserSetup(ctx context.Context, options UserSetupOptions) (map[string]interface{}, error)
174 UserUnsetup(ctx context.Context, options GetOptions) (User, error)
175 UserGet(ctx context.Context, options GetOptions) (User, error)
176 UserGetCurrent(ctx context.Context, options GetOptions) (User, error)
177 UserGetSystem(ctx context.Context, options GetOptions) (User, error)
178 UserList(ctx context.Context, options ListOptions) (UserList, error)
179 UserDelete(ctx context.Context, options DeleteOptions) (User, error)
180 UserBatchUpdate(context.Context, UserBatchUpdateOptions) (UserList, error)
181 APIClientAuthorizationCurrent(ctx context.Context, options GetOptions) (APIClientAuthorization, error)