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 EndpointLogout = APIEndpoint{"GET", "logout", ""}
23 EndpointCollectionCreate = APIEndpoint{"POST", "arvados/v1/collections", "collection"}
24 EndpointCollectionUpdate = APIEndpoint{"PATCH", "arvados/v1/collections/{uuid}", "collection"}
25 EndpointCollectionGet = APIEndpoint{"GET", "arvados/v1/collections/{uuid}", ""}
26 EndpointCollectionList = APIEndpoint{"GET", "arvados/v1/collections", ""}
27 EndpointCollectionProvenance = APIEndpoint{"GET", "arvados/v1/collections/{uuid}/provenance", ""}
28 EndpointCollectionUsedBy = APIEndpoint{"GET", "arvados/v1/collections/{uuid}/used_by", ""}
29 EndpointCollectionDelete = APIEndpoint{"DELETE", "arvados/v1/collections/{uuid}", ""}
30 EndpointCollectionTrash = APIEndpoint{"POST", "arvados/v1/collections/{uuid}/trash", ""}
31 EndpointCollectionUntrash = APIEndpoint{"POST", "arvados/v1/collections/{uuid}/untrash", ""}
32 EndpointSpecimenCreate = APIEndpoint{"POST", "arvados/v1/specimens", "specimen"}
33 EndpointSpecimenUpdate = APIEndpoint{"PATCH", "arvados/v1/specimens/{uuid}", "specimen"}
34 EndpointSpecimenGet = APIEndpoint{"GET", "arvados/v1/specimens/{uuid}", ""}
35 EndpointSpecimenList = APIEndpoint{"GET", "arvados/v1/specimens", ""}
36 EndpointSpecimenDelete = APIEndpoint{"DELETE", "arvados/v1/specimens/{uuid}", ""}
37 EndpointContainerCreate = APIEndpoint{"POST", "arvados/v1/containers", "container"}
38 EndpointContainerUpdate = APIEndpoint{"PATCH", "arvados/v1/containers/{uuid}", "container"}
39 EndpointContainerGet = APIEndpoint{"GET", "arvados/v1/containers/{uuid}", ""}
40 EndpointContainerList = APIEndpoint{"GET", "arvados/v1/containers", ""}
41 EndpointContainerDelete = APIEndpoint{"DELETE", "arvados/v1/containers/{uuid}", ""}
42 EndpointContainerLock = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/lock", ""}
43 EndpointContainerUnlock = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/unlock", ""}
44 EndpointUserActivate = APIEndpoint{"POST", "arvados/v1/users/{uuid}/activate", ""}
45 EndpointUserCreate = APIEndpoint{"POST", "arvados/v1/users", "user"}
46 EndpointUserCurrent = APIEndpoint{"GET", "arvados/v1/users/current", ""}
47 EndpointUserDelete = APIEndpoint{"DELETE", "arvados/v1/users/{uuid}", ""}
48 EndpointUserGet = APIEndpoint{"GET", "arvados/v1/users/{uuid}", ""}
49 EndpointUserGetCurrent = APIEndpoint{"GET", "arvados/v1/users/current", ""}
50 EndpointUserGetSystem = APIEndpoint{"GET", "arvados/v1/users/system", ""}
51 EndpointUserList = APIEndpoint{"GET", "arvados/v1/users", ""}
52 EndpointUserMerge = APIEndpoint{"POST", "arvados/v1/users/merge", ""}
53 EndpointUserSetup = APIEndpoint{"POST", "arvados/v1/users/setup", "user"}
54 EndpointUserSystem = APIEndpoint{"GET", "arvados/v1/users/system", ""}
55 EndpointUserUnsetup = APIEndpoint{"POST", "arvados/v1/users/{uuid}/unsetup", ""}
56 EndpointUserUpdate = APIEndpoint{"PATCH", "arvados/v1/users/{uuid}", "user"}
57 EndpointUserUpdateUUID = APIEndpoint{"POST", "arvados/v1/users/{uuid}/update_uuid", ""}
58 EndpointUserBatchUpdate = APIEndpoint{"PATCH", "arvados/v1/users/batch", ""}
59 EndpointAPIClientAuthorizationCurrent = APIEndpoint{"GET", "arvados/v1/api_client_authorizations/current", ""}
62 type GetOptions struct {
63 UUID string `json:"uuid,omitempty"`
64 Select []string `json:"select"`
65 IncludeTrash bool `json:"include_trash"`
66 ForwardedFor string `json:"forwarded_for,omitempty"`
67 Remote string `json:"remote,omitempty"`
70 type UntrashOptions struct {
71 UUID string `json:"uuid"`
72 EnsureUniqueName bool `json:"ensure_unique_name"`
75 type ListOptions struct {
76 ClusterID string `json:"cluster_id"`
77 Select []string `json:"select"`
78 Filters []Filter `json:"filters"`
79 Where map[string]interface{} `json:"where"`
80 Limit int64 `json:"limit"`
81 Offset int64 `json:"offset"`
82 Order []string `json:"order"`
83 Distinct bool `json:"distinct"`
84 Count string `json:"count"`
85 IncludeTrash bool `json:"include_trash"`
86 IncludeOldVersions bool `json:"include_old_versions"`
87 NoFederation bool `json:"no_federation"`
90 type CreateOptions struct {
91 ClusterID string `json:"cluster_id"`
92 EnsureUniqueName bool `json:"ensure_unique_name"`
93 Select []string `json:"select"`
94 Attrs map[string]interface{} `json:"attrs"`
97 type UpdateOptions struct {
98 UUID string `json:"uuid"`
99 Attrs map[string]interface{} `json:"attrs"`
100 NoFederation bool `json:"no_federation"`
103 type UpdateUUIDOptions struct {
104 UUID string `json:"uuid"`
105 NewUUID string `json:"new_uuid"`
108 type UserActivateOptions struct {
109 UUID string `json:"uuid"`
112 type UserSetupOptions struct {
113 UUID string `json:"uuid,omitempty"`
114 Email string `json:"email,omitempty"`
115 OpenIDPrefix string `json:"openid_prefix,omitempty"`
116 RepoName string `json:"repo_name,omitempty"`
117 VMUUID string `json:"vm_uuid,omitempty"`
118 SendNotificationEmail bool `json:"send_notification_email,omitempty"`
119 Attrs map[string]interface{} `json:"attrs"`
122 type UserMergeOptions struct {
123 NewUserUUID string `json:"new_user_uuid,omitempty"`
124 OldUserUUID string `json:"old_user_uuid,omitempty"`
125 NewOwnerUUID string `json:"new_owner_uuid,omitempty"`
126 NewUserToken string `json:"new_user_token,omitempty"`
127 RedirectToNewUser bool `json:"redirect_to_new_user"`
130 type UserBatchUpdateOptions struct {
131 Updates map[string]map[string]interface{} `json:"updates"`
134 type UserBatchUpdateResponse struct{}
136 type DeleteOptions struct {
137 UUID string `json:"uuid"`
140 type LoginOptions struct {
141 ReturnTo string `json:"return_to"` // On success, redirect to this target with api_token=xxx query param
142 Remote string `json:"remote,omitempty"` // Salt token for remote Cluster ID
143 Code string `json:"code,omitempty"` // OAuth2 callback code
144 State string `json:"state,omitempty"` // OAuth2 callback state
147 type LogoutOptions struct {
148 ReturnTo string `json:"return_to"` // Redirect to this URL after logging out
152 ConfigGet(ctx context.Context) (json.RawMessage, error)
153 Login(ctx context.Context, options LoginOptions) (LoginResponse, error)
154 Logout(ctx context.Context, options LogoutOptions) (LogoutResponse, error)
155 CollectionCreate(ctx context.Context, options CreateOptions) (Collection, error)
156 CollectionUpdate(ctx context.Context, options UpdateOptions) (Collection, error)
157 CollectionGet(ctx context.Context, options GetOptions) (Collection, error)
158 CollectionList(ctx context.Context, options ListOptions) (CollectionList, error)
159 CollectionProvenance(ctx context.Context, options GetOptions) (map[string]interface{}, error)
160 CollectionUsedBy(ctx context.Context, options GetOptions) (map[string]interface{}, error)
161 CollectionDelete(ctx context.Context, options DeleteOptions) (Collection, error)
162 CollectionTrash(ctx context.Context, options DeleteOptions) (Collection, error)
163 CollectionUntrash(ctx context.Context, options UntrashOptions) (Collection, error)
164 ContainerCreate(ctx context.Context, options CreateOptions) (Container, error)
165 ContainerUpdate(ctx context.Context, options UpdateOptions) (Container, error)
166 ContainerGet(ctx context.Context, options GetOptions) (Container, error)
167 ContainerList(ctx context.Context, options ListOptions) (ContainerList, error)
168 ContainerDelete(ctx context.Context, options DeleteOptions) (Container, error)
169 ContainerLock(ctx context.Context, options GetOptions) (Container, error)
170 ContainerUnlock(ctx context.Context, options GetOptions) (Container, error)
171 SpecimenCreate(ctx context.Context, options CreateOptions) (Specimen, error)
172 SpecimenUpdate(ctx context.Context, options UpdateOptions) (Specimen, error)
173 SpecimenGet(ctx context.Context, options GetOptions) (Specimen, error)
174 SpecimenList(ctx context.Context, options ListOptions) (SpecimenList, error)
175 SpecimenDelete(ctx context.Context, options DeleteOptions) (Specimen, error)
176 UserCreate(ctx context.Context, options CreateOptions) (User, error)
177 UserUpdate(ctx context.Context, options UpdateOptions) (User, error)
178 UserUpdateUUID(ctx context.Context, options UpdateUUIDOptions) (User, error)
179 UserMerge(ctx context.Context, options UserMergeOptions) (User, error)
180 UserActivate(ctx context.Context, options UserActivateOptions) (User, error)
181 UserSetup(ctx context.Context, options UserSetupOptions) (map[string]interface{}, error)
182 UserUnsetup(ctx context.Context, options GetOptions) (User, error)
183 UserGet(ctx context.Context, options GetOptions) (User, error)
184 UserGetCurrent(ctx context.Context, options GetOptions) (User, error)
185 UserGetSystem(ctx context.Context, options GetOptions) (User, error)
186 UserList(ctx context.Context, options ListOptions) (UserList, error)
187 UserDelete(ctx context.Context, options DeleteOptions) (User, error)
188 UserBatchUpdate(context.Context, UserBatchUpdateOptions) (UserList, error)
189 APIClientAuthorizationCurrent(ctx context.Context, options GetOptions) (APIClientAuthorization, error)