diff --git a/components/public-api-server/pkg/apiv1/workspace.go b/components/public-api-server/pkg/apiv1/workspace.go index 7f82cc87223d28..78a1f6403d029b 100644 --- a/components/public-api-server/pkg/apiv1/workspace.go +++ b/components/public-api-server/pkg/apiv1/workspace.go @@ -231,6 +231,32 @@ func (s *WorkspaceService) StopWorkspace(ctx context.Context, req *connect.Reque return connect.NewResponse(&v1.StopWorkspaceResponse{}), nil } +func (s *WorkspaceService) StartWorkspace(ctx context.Context, req *connect.Request[v1.StartWorkspaceRequest]) (*connect.Response[v1.StartWorkspaceResponse], error) { + workspaceID, err := validateWorkspaceID(ctx, req.Msg.GetWorkspaceId()) + if err != nil { + return nil, err + } + conn, err := getConnection(ctx, s.connectionPool) + if err != nil { + return nil, err + } + + if err != nil { + return nil, err + } + + startWorkspaceResult, err := conn.StartWorkspace(ctx, workspaceID, &protocol.StartWorkspaceOptions{}) + + if err != nil { + return nil, err + } + + return connect.NewResponse(&v1.StartWorkspaceResponse{ + WorkspaceUrl: startWorkspaceResult.WorkspaceURL, + InstanceId: startWorkspaceResult.InstanceID, + }), nil +} + func (s *WorkspaceService) DeleteWorkspace(ctx context.Context, req *connect.Request[v1.DeleteWorkspaceRequest]) (*connect.Response[v1.DeleteWorkspaceResponse], error) { workspaceID, err := validateWorkspaceID(ctx, req.Msg.GetWorkspaceId()) if err != nil { diff --git a/components/public-api/gitpod/experimental/v1/workspaces.proto b/components/public-api/gitpod/experimental/v1/workspaces.proto index 8d85aa623057bf..c10ffc3a08a877 100644 --- a/components/public-api/gitpod/experimental/v1/workspaces.proto +++ b/components/public-api/gitpod/experimental/v1/workspaces.proto @@ -25,6 +25,9 @@ service WorkspacesService { // CreateAndStartWorkspace creates a new workspace and starts it. rpc CreateAndStartWorkspace(CreateAndStartWorkspaceRequest) returns (CreateAndStartWorkspaceResponse) {} + // StartWorkspace starts an existing user's workspace + rpc StartWorkspace(StartWorkspaceRequest) returns (StartWorkspaceResponse) {} + // StopWorkspace stops a running workspace (instance). // Errors: // NOT_FOUND: the workspace_id is unkown diff --git a/components/public-api/go/experimental/v1/v1connect/workspaces.connect.go b/components/public-api/go/experimental/v1/v1connect/workspaces.connect.go index a2597d5bb50135..8765d4e66ba9fd 100644 --- a/components/public-api/go/experimental/v1/v1connect/workspaces.connect.go +++ b/components/public-api/go/experimental/v1/v1connect/workspaces.connect.go @@ -41,6 +41,8 @@ type WorkspacesServiceClient interface { GetOwnerToken(context.Context, *connect_go.Request[v1.GetOwnerTokenRequest]) (*connect_go.Response[v1.GetOwnerTokenResponse], error) // CreateAndStartWorkspace creates a new workspace and starts it. CreateAndStartWorkspace(context.Context, *connect_go.Request[v1.CreateAndStartWorkspaceRequest]) (*connect_go.Response[v1.CreateAndStartWorkspaceResponse], error) + // StartWorkspace starts an existing user's workspace + StartWorkspace(context.Context, *connect_go.Request[v1.StartWorkspaceRequest]) (*connect_go.Response[v1.StartWorkspaceResponse], error) // StopWorkspace stops a running workspace (instance). // Errors: // @@ -89,6 +91,11 @@ func NewWorkspacesServiceClient(httpClient connect_go.HTTPClient, baseURL string baseURL+"/gitpod.experimental.v1.WorkspacesService/CreateAndStartWorkspace", opts..., ), + startWorkspace: connect_go.NewClient[v1.StartWorkspaceRequest, v1.StartWorkspaceResponse]( + httpClient, + baseURL+"/gitpod.experimental.v1.WorkspacesService/StartWorkspace", + opts..., + ), stopWorkspace: connect_go.NewClient[v1.StopWorkspaceRequest, v1.StopWorkspaceResponse]( httpClient, baseURL+"/gitpod.experimental.v1.WorkspacesService/StopWorkspace", @@ -114,6 +121,7 @@ type workspacesServiceClient struct { streamWorkspaceStatus *connect_go.Client[v1.StreamWorkspaceStatusRequest, v1.StreamWorkspaceStatusResponse] getOwnerToken *connect_go.Client[v1.GetOwnerTokenRequest, v1.GetOwnerTokenResponse] createAndStartWorkspace *connect_go.Client[v1.CreateAndStartWorkspaceRequest, v1.CreateAndStartWorkspaceResponse] + startWorkspace *connect_go.Client[v1.StartWorkspaceRequest, v1.StartWorkspaceResponse] stopWorkspace *connect_go.Client[v1.StopWorkspaceRequest, v1.StopWorkspaceResponse] deleteWorkspace *connect_go.Client[v1.DeleteWorkspaceRequest, v1.DeleteWorkspaceResponse] updatePort *connect_go.Client[v1.UpdatePortRequest, v1.UpdatePortResponse] @@ -144,6 +152,11 @@ func (c *workspacesServiceClient) CreateAndStartWorkspace(ctx context.Context, r return c.createAndStartWorkspace.CallUnary(ctx, req) } +// StartWorkspace calls gitpod.experimental.v1.WorkspacesService.StartWorkspace. +func (c *workspacesServiceClient) StartWorkspace(ctx context.Context, req *connect_go.Request[v1.StartWorkspaceRequest]) (*connect_go.Response[v1.StartWorkspaceResponse], error) { + return c.startWorkspace.CallUnary(ctx, req) +} + // StopWorkspace calls gitpod.experimental.v1.WorkspacesService.StopWorkspace. func (c *workspacesServiceClient) StopWorkspace(ctx context.Context, req *connect_go.Request[v1.StopWorkspaceRequest]) (*connect_go.Response[v1.StopWorkspaceResponse], error) { return c.stopWorkspace.CallUnary(ctx, req) @@ -172,6 +185,8 @@ type WorkspacesServiceHandler interface { GetOwnerToken(context.Context, *connect_go.Request[v1.GetOwnerTokenRequest]) (*connect_go.Response[v1.GetOwnerTokenResponse], error) // CreateAndStartWorkspace creates a new workspace and starts it. CreateAndStartWorkspace(context.Context, *connect_go.Request[v1.CreateAndStartWorkspaceRequest]) (*connect_go.Response[v1.CreateAndStartWorkspaceResponse], error) + // StartWorkspace starts an existing user's workspace + StartWorkspace(context.Context, *connect_go.Request[v1.StartWorkspaceRequest]) (*connect_go.Response[v1.StartWorkspaceResponse], error) // StopWorkspace stops a running workspace (instance). // Errors: // @@ -217,6 +232,11 @@ func NewWorkspacesServiceHandler(svc WorkspacesServiceHandler, opts ...connect_g svc.CreateAndStartWorkspace, opts..., )) + mux.Handle("/gitpod.experimental.v1.WorkspacesService/StartWorkspace", connect_go.NewUnaryHandler( + "/gitpod.experimental.v1.WorkspacesService/StartWorkspace", + svc.StartWorkspace, + opts..., + )) mux.Handle("/gitpod.experimental.v1.WorkspacesService/StopWorkspace", connect_go.NewUnaryHandler( "/gitpod.experimental.v1.WorkspacesService/StopWorkspace", svc.StopWorkspace, @@ -258,6 +278,10 @@ func (UnimplementedWorkspacesServiceHandler) CreateAndStartWorkspace(context.Con return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.WorkspacesService.CreateAndStartWorkspace is not implemented")) } +func (UnimplementedWorkspacesServiceHandler) StartWorkspace(context.Context, *connect_go.Request[v1.StartWorkspaceRequest]) (*connect_go.Response[v1.StartWorkspaceResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.WorkspacesService.StartWorkspace is not implemented")) +} + func (UnimplementedWorkspacesServiceHandler) StopWorkspace(context.Context, *connect_go.Request[v1.StopWorkspaceRequest]) (*connect_go.Response[v1.StopWorkspaceResponse], error) { return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.WorkspacesService.StopWorkspace is not implemented")) } diff --git a/components/public-api/go/experimental/v1/v1connect/workspaces.proxy.connect.go b/components/public-api/go/experimental/v1/v1connect/workspaces.proxy.connect.go index 5e5ac7b3fb5f92..fa0c2159870bd0 100644 --- a/components/public-api/go/experimental/v1/v1connect/workspaces.proxy.connect.go +++ b/components/public-api/go/experimental/v1/v1connect/workspaces.proxy.connect.go @@ -59,6 +59,16 @@ func (s *ProxyWorkspacesServiceHandler) CreateAndStartWorkspace(ctx context.Cont return connect_go.NewResponse(resp), nil } +func (s *ProxyWorkspacesServiceHandler) StartWorkspace(ctx context.Context, req *connect_go.Request[v1.StartWorkspaceRequest]) (*connect_go.Response[v1.StartWorkspaceResponse], error) { + resp, err := s.Client.StartWorkspace(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + func (s *ProxyWorkspacesServiceHandler) StopWorkspace(ctx context.Context, req *connect_go.Request[v1.StopWorkspaceRequest]) (*connect_go.Response[v1.StopWorkspaceResponse], error) { resp, err := s.Client.StopWorkspace(ctx, req.Msg) if err != nil { diff --git a/components/public-api/go/experimental/v1/workspaces.pb.go b/components/public-api/go/experimental/v1/workspaces.pb.go index 7fca2f51bf7553..cfcd2a7be70dd7 100644 --- a/components/public-api/go/experimental/v1/workspaces.pb.go +++ b/components/public-api/go/experimental/v1/workspaces.pb.go @@ -2235,7 +2235,7 @@ var file_gitpod_experimental_v1_workspaces_proto_rawDesc = []byte{ 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x41, 0x44, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x45, 0x56, 0x45, 0x52, 0x59, 0x4f, 0x4e, 0x45, 0x10, 0x02, - 0x32, 0xca, 0x07, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x53, + 0x32, 0xbd, 0x08, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x71, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, @@ -2275,32 +2275,39 @@ var file_gitpod_experimental_v1_workspaces_proto_rawDesc = []byte{ 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x6e, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x12, 0x2c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, - 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x57, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, - 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x57, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x74, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x12, 0x2e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, - 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, - 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x65, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x6f, 0x72, 0x74, 0x12, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, - 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, - 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x46, 0x5a, - 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, - 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, - 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, - 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x71, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, + 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, + 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x12, 0x2c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, + 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, + 0x6f, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, + 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, + 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x65, 0x0a, 0x0a, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, + 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0x46, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, + 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2385,19 +2392,21 @@ var file_gitpod_experimental_v1_workspaces_proto_depIdxs = []int32{ 7, // 26: gitpod.experimental.v1.WorkspacesService.StreamWorkspaceStatus:input_type -> gitpod.experimental.v1.StreamWorkspaceStatusRequest 9, // 27: gitpod.experimental.v1.WorkspacesService.GetOwnerToken:input_type -> gitpod.experimental.v1.GetOwnerTokenRequest 11, // 28: gitpod.experimental.v1.WorkspacesService.CreateAndStartWorkspace:input_type -> gitpod.experimental.v1.CreateAndStartWorkspaceRequest - 15, // 29: gitpod.experimental.v1.WorkspacesService.StopWorkspace:input_type -> gitpod.experimental.v1.StopWorkspaceRequest - 17, // 30: gitpod.experimental.v1.WorkspacesService.DeleteWorkspace:input_type -> gitpod.experimental.v1.DeleteWorkspaceRequest - 27, // 31: gitpod.experimental.v1.WorkspacesService.UpdatePort:input_type -> gitpod.experimental.v1.UpdatePortRequest - 4, // 32: gitpod.experimental.v1.WorkspacesService.ListWorkspaces:output_type -> gitpod.experimental.v1.ListWorkspacesResponse - 6, // 33: gitpod.experimental.v1.WorkspacesService.GetWorkspace:output_type -> gitpod.experimental.v1.GetWorkspaceResponse - 8, // 34: gitpod.experimental.v1.WorkspacesService.StreamWorkspaceStatus:output_type -> gitpod.experimental.v1.StreamWorkspaceStatusResponse - 10, // 35: gitpod.experimental.v1.WorkspacesService.GetOwnerToken:output_type -> gitpod.experimental.v1.GetOwnerTokenResponse - 12, // 36: gitpod.experimental.v1.WorkspacesService.CreateAndStartWorkspace:output_type -> gitpod.experimental.v1.CreateAndStartWorkspaceResponse - 16, // 37: gitpod.experimental.v1.WorkspacesService.StopWorkspace:output_type -> gitpod.experimental.v1.StopWorkspaceResponse - 18, // 38: gitpod.experimental.v1.WorkspacesService.DeleteWorkspace:output_type -> gitpod.experimental.v1.DeleteWorkspaceResponse - 28, // 39: gitpod.experimental.v1.WorkspacesService.UpdatePort:output_type -> gitpod.experimental.v1.UpdatePortResponse - 32, // [32:40] is the sub-list for method output_type - 24, // [24:32] is the sub-list for method input_type + 13, // 29: gitpod.experimental.v1.WorkspacesService.StartWorkspace:input_type -> gitpod.experimental.v1.StartWorkspaceRequest + 15, // 30: gitpod.experimental.v1.WorkspacesService.StopWorkspace:input_type -> gitpod.experimental.v1.StopWorkspaceRequest + 17, // 31: gitpod.experimental.v1.WorkspacesService.DeleteWorkspace:input_type -> gitpod.experimental.v1.DeleteWorkspaceRequest + 27, // 32: gitpod.experimental.v1.WorkspacesService.UpdatePort:input_type -> gitpod.experimental.v1.UpdatePortRequest + 4, // 33: gitpod.experimental.v1.WorkspacesService.ListWorkspaces:output_type -> gitpod.experimental.v1.ListWorkspacesResponse + 6, // 34: gitpod.experimental.v1.WorkspacesService.GetWorkspace:output_type -> gitpod.experimental.v1.GetWorkspaceResponse + 8, // 35: gitpod.experimental.v1.WorkspacesService.StreamWorkspaceStatus:output_type -> gitpod.experimental.v1.StreamWorkspaceStatusResponse + 10, // 36: gitpod.experimental.v1.WorkspacesService.GetOwnerToken:output_type -> gitpod.experimental.v1.GetOwnerTokenResponse + 12, // 37: gitpod.experimental.v1.WorkspacesService.CreateAndStartWorkspace:output_type -> gitpod.experimental.v1.CreateAndStartWorkspaceResponse + 14, // 38: gitpod.experimental.v1.WorkspacesService.StartWorkspace:output_type -> gitpod.experimental.v1.StartWorkspaceResponse + 16, // 39: gitpod.experimental.v1.WorkspacesService.StopWorkspace:output_type -> gitpod.experimental.v1.StopWorkspaceResponse + 18, // 40: gitpod.experimental.v1.WorkspacesService.DeleteWorkspace:output_type -> gitpod.experimental.v1.DeleteWorkspaceResponse + 28, // 41: gitpod.experimental.v1.WorkspacesService.UpdatePort:output_type -> gitpod.experimental.v1.UpdatePortResponse + 33, // [33:42] is the sub-list for method output_type + 24, // [24:33] is the sub-list for method input_type 24, // [24:24] is the sub-list for extension type_name 24, // [24:24] is the sub-list for extension extendee 0, // [0:24] is the sub-list for field type_name diff --git a/components/public-api/go/experimental/v1/workspaces_grpc.pb.go b/components/public-api/go/experimental/v1/workspaces_grpc.pb.go index 32cb3cd24af6d8..1aa8fe40f84101 100644 --- a/components/public-api/go/experimental/v1/workspaces_grpc.pb.go +++ b/components/public-api/go/experimental/v1/workspaces_grpc.pb.go @@ -36,6 +36,8 @@ type WorkspacesServiceClient interface { GetOwnerToken(ctx context.Context, in *GetOwnerTokenRequest, opts ...grpc.CallOption) (*GetOwnerTokenResponse, error) // CreateAndStartWorkspace creates a new workspace and starts it. CreateAndStartWorkspace(ctx context.Context, in *CreateAndStartWorkspaceRequest, opts ...grpc.CallOption) (*CreateAndStartWorkspaceResponse, error) + // StartWorkspace starts an existing user's workspace + StartWorkspace(ctx context.Context, in *StartWorkspaceRequest, opts ...grpc.CallOption) (*StartWorkspaceResponse, error) // StopWorkspace stops a running workspace (instance). // Errors: // @@ -125,6 +127,15 @@ func (c *workspacesServiceClient) CreateAndStartWorkspace(ctx context.Context, i return out, nil } +func (c *workspacesServiceClient) StartWorkspace(ctx context.Context, in *StartWorkspaceRequest, opts ...grpc.CallOption) (*StartWorkspaceResponse, error) { + out := new(StartWorkspaceResponse) + err := c.cc.Invoke(ctx, "/gitpod.experimental.v1.WorkspacesService/StartWorkspace", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *workspacesServiceClient) StopWorkspace(ctx context.Context, in *StopWorkspaceRequest, opts ...grpc.CallOption) (*StopWorkspaceResponse, error) { out := new(StopWorkspaceResponse) err := c.cc.Invoke(ctx, "/gitpod.experimental.v1.WorkspacesService/StopWorkspace", in, out, opts...) @@ -166,6 +177,8 @@ type WorkspacesServiceServer interface { GetOwnerToken(context.Context, *GetOwnerTokenRequest) (*GetOwnerTokenResponse, error) // CreateAndStartWorkspace creates a new workspace and starts it. CreateAndStartWorkspace(context.Context, *CreateAndStartWorkspaceRequest) (*CreateAndStartWorkspaceResponse, error) + // StartWorkspace starts an existing user's workspace + StartWorkspace(context.Context, *StartWorkspaceRequest) (*StartWorkspaceResponse, error) // StopWorkspace stops a running workspace (instance). // Errors: // @@ -199,6 +212,9 @@ func (UnimplementedWorkspacesServiceServer) GetOwnerToken(context.Context, *GetO func (UnimplementedWorkspacesServiceServer) CreateAndStartWorkspace(context.Context, *CreateAndStartWorkspaceRequest) (*CreateAndStartWorkspaceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAndStartWorkspace not implemented") } +func (UnimplementedWorkspacesServiceServer) StartWorkspace(context.Context, *StartWorkspaceRequest) (*StartWorkspaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartWorkspace not implemented") +} func (UnimplementedWorkspacesServiceServer) StopWorkspace(context.Context, *StopWorkspaceRequest) (*StopWorkspaceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StopWorkspace not implemented") } @@ -314,6 +330,24 @@ func _WorkspacesService_CreateAndStartWorkspace_Handler(srv interface{}, ctx con return interceptor(ctx, in, info, handler) } +func _WorkspacesService_StartWorkspace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartWorkspaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkspacesServiceServer).StartWorkspace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.experimental.v1.WorkspacesService/StartWorkspace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkspacesServiceServer).StartWorkspace(ctx, req.(*StartWorkspaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _WorkspacesService_StopWorkspace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StopWorkspaceRequest) if err := dec(in); err != nil { @@ -391,6 +425,10 @@ var WorkspacesService_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateAndStartWorkspace", Handler: _WorkspacesService_CreateAndStartWorkspace_Handler, }, + { + MethodName: "StartWorkspace", + Handler: _WorkspacesService_StartWorkspace_Handler, + }, { MethodName: "StopWorkspace", Handler: _WorkspacesService_StopWorkspace_Handler, diff --git a/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_connectweb.ts b/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_connectweb.ts index ba0a753ffa258b..560062c6d190fa 100644 --- a/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_connectweb.ts +++ b/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_connectweb.ts @@ -9,7 +9,7 @@ /* eslint-disable */ /* @ts-nocheck */ -import {CreateAndStartWorkspaceRequest, CreateAndStartWorkspaceResponse, DeleteWorkspaceRequest, DeleteWorkspaceResponse, GetOwnerTokenRequest, GetOwnerTokenResponse, GetWorkspaceRequest, GetWorkspaceResponse, ListWorkspacesRequest, ListWorkspacesResponse, StopWorkspaceRequest, StopWorkspaceResponse, StreamWorkspaceStatusRequest, StreamWorkspaceStatusResponse, UpdatePortRequest, UpdatePortResponse} from "./workspaces_pb.js"; +import {CreateAndStartWorkspaceRequest, CreateAndStartWorkspaceResponse, DeleteWorkspaceRequest, DeleteWorkspaceResponse, GetOwnerTokenRequest, GetOwnerTokenResponse, GetWorkspaceRequest, GetWorkspaceResponse, ListWorkspacesRequest, ListWorkspacesResponse, StartWorkspaceRequest, StartWorkspaceResponse, StopWorkspaceRequest, StopWorkspaceResponse, StreamWorkspaceStatusRequest, StreamWorkspaceStatusResponse, UpdatePortRequest, UpdatePortResponse} from "./workspaces_pb.js"; import {MethodKind} from "@bufbuild/protobuf"; /** @@ -73,6 +73,17 @@ export const WorkspacesService = { O: CreateAndStartWorkspaceResponse, kind: MethodKind.Unary, }, + /** + * StartWorkspace starts an existing user's workspace + * + * @generated from rpc gitpod.experimental.v1.WorkspacesService.StartWorkspace + */ + startWorkspace: { + name: "StartWorkspace", + I: StartWorkspaceRequest, + O: StartWorkspaceResponse, + kind: MethodKind.Unary, + }, /** * StopWorkspace stops a running workspace (instance). * Errors: @@ -111,4 +122,3 @@ export const WorkspacesService = { }, } } as const; -