X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9a1056497d7b7ad18769336489d3a6822547b65a..6ddd57f1da6139b76db95ad16cccbb95eab01e5d:/sdk/go/arvados/api.go diff --git a/sdk/go/arvados/api.go b/sdk/go/arvados/api.go index 7409b18132..bec387e857 100644 --- a/sdk/go/arvados/api.go +++ b/sdk/go/arvados/api.go @@ -10,6 +10,7 @@ import ( "encoding/json" "io" "net" + "net/http" "github.com/sirupsen/logrus" ) @@ -47,7 +48,8 @@ var ( EndpointContainerDelete = APIEndpoint{"DELETE", "arvados/v1/containers/{uuid}", ""} EndpointContainerLock = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/lock", ""} EndpointContainerUnlock = APIEndpoint{"POST", "arvados/v1/containers/{uuid}/unlock", ""} - EndpointContainerSSH = APIEndpoint{"GET", "arvados/v1/connect/{uuid}/ssh", ""} // move to /containers after #17014 fixes routing + EndpointContainerSSH = APIEndpoint{"POST", "arvados/v1/connect/{uuid}/ssh", ""} // move to /containers after #17014 fixes routing + EndpointContainerGatewayTunnel = APIEndpoint{"POST", "arvados/v1/connect/{uuid}/gateway_tunnel", ""} // move to /containers after #17014 fixes routing EndpointContainerRequestCreate = APIEndpoint{"POST", "arvados/v1/container_requests", "container_request"} EndpointContainerRequestUpdate = APIEndpoint{"PATCH", "arvados/v1/container_requests/{uuid}", "container_request"} EndpointContainerRequestGet = APIEndpoint{"GET", "arvados/v1/container_requests/{uuid}", ""} @@ -68,6 +70,11 @@ var ( EndpointLinkGet = APIEndpoint{"GET", "arvados/v1/links/{uuid}", ""} EndpointLinkList = APIEndpoint{"GET", "arvados/v1/links", ""} EndpointLinkDelete = APIEndpoint{"DELETE", "arvados/v1/links/{uuid}", ""} + EndpointLogCreate = APIEndpoint{"POST", "arvados/v1/logs", "log"} + EndpointLogUpdate = APIEndpoint{"PATCH", "arvados/v1/logs/{uuid}", "log"} + EndpointLogGet = APIEndpoint{"GET", "arvados/v1/logs/{uuid}", ""} + EndpointLogList = APIEndpoint{"GET", "arvados/v1/logs", ""} + EndpointLogDelete = APIEndpoint{"DELETE", "arvados/v1/logs/{uuid}", ""} EndpointSysTrashSweep = APIEndpoint{"POST", "sys/trash_sweep", ""} EndpointUserActivate = APIEndpoint{"POST", "arvados/v1/users/{uuid}/activate", ""} EndpointUserCreate = APIEndpoint{"POST", "arvados/v1/users", "user"} @@ -96,12 +103,19 @@ type ContainerSSHOptions struct { UUID string `json:"uuid"` DetachKeys string `json:"detach_keys"` LoginUsername string `json:"login_username"` + NoForward bool `json:"no_forward"` } -type ContainerSSHConnection struct { +type ConnectionResponse struct { Conn net.Conn `json:"-"` Bufrw *bufio.ReadWriter `json:"-"` Logger logrus.FieldLogger `json:"-"` + Header http.Header `json:"-"` +} + +type ContainerGatewayTunnelOptions struct { + UUID string `json:"uuid"` + AuthSecret string `json:"auth_secret"` } type GetOptions struct { @@ -139,6 +153,8 @@ type CreateOptions struct { EnsureUniqueName bool `json:"ensure_unique_name"` Select []string `json:"select"` Attrs map[string]interface{} `json:"attrs"` + // ReplaceFiles only applies when creating a collection. + ReplaceFiles map[string]string `json:"replace_files"` } type UpdateOptions struct { @@ -146,6 +162,8 @@ type UpdateOptions struct { Attrs map[string]interface{} `json:"attrs"` Select []string `json:"select"` BypassFederation bool `json:"bypass_federation"` + // ReplaceFiles only applies when updating a collection. + ReplaceFiles map[string]string `json:"replace_files"` } type GroupContentsOptions struct { @@ -250,7 +268,8 @@ type API interface { ContainerDelete(ctx context.Context, options DeleteOptions) (Container, error) ContainerLock(ctx context.Context, options GetOptions) (Container, error) ContainerUnlock(ctx context.Context, options GetOptions) (Container, error) - ContainerSSH(ctx context.Context, options ContainerSSHOptions) (ContainerSSHConnection, error) + ContainerSSH(ctx context.Context, options ContainerSSHOptions) (ConnectionResponse, error) + ContainerGatewayTunnel(ctx context.Context, options ContainerGatewayTunnelOptions) (ConnectionResponse, error) ContainerRequestCreate(ctx context.Context, options CreateOptions) (ContainerRequest, error) ContainerRequestUpdate(ctx context.Context, options UpdateOptions) (ContainerRequest, error) ContainerRequestGet(ctx context.Context, options GetOptions) (ContainerRequest, error) @@ -270,6 +289,11 @@ type API interface { LinkGet(ctx context.Context, options GetOptions) (Link, error) LinkList(ctx context.Context, options ListOptions) (LinkList, error) LinkDelete(ctx context.Context, options DeleteOptions) (Link, error) + LogCreate(ctx context.Context, options CreateOptions) (Log, error) + LogUpdate(ctx context.Context, options UpdateOptions) (Log, error) + LogGet(ctx context.Context, options GetOptions) (Log, error) + LogList(ctx context.Context, options ListOptions) (LogList, error) + LogDelete(ctx context.Context, options DeleteOptions) (Log, 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)