init InspectService method

This commit is contained in:
Pavel Sviderski
2024-12-02 20:36:31 +10:00
parent 6a4a7f2e6a
commit 6eb373e4de
10 changed files with 561 additions and 110 deletions
+12 -2
View File
@@ -15,6 +15,7 @@ import (
"uncloud/internal/machine/api/pb"
machinedocker "uncloud/internal/machine/docker"
"uncloud/internal/secret"
"uncloud/internal/service"
)
// ServiceOptions contains all the options for creating a service.
@@ -42,8 +43,8 @@ func (c *Client) RunService(ctx context.Context, opts *ServiceOptions) (RunServi
}
switch opts.Mode {
case docker.DeployModeReplicated:
case docker.DeployModeGlobal:
case service.ModeReplicated:
case service.ModeGlobal:
return resp, errors.New("global mode is not supported yet")
default:
return resp, fmt.Errorf("invalid mode: %q", opts.Mode)
@@ -155,3 +156,12 @@ func firstAvailableMachine(machines []*pb.MachineMember) (*pb.MachineMember, err
return nil, errors.New("no available machine to run the service")
}
func (c *Client) InspectService(ctx context.Context, id string) error {
_, err := c.MachineClient.InspectService(ctx, &pb.InspectServiceRequest{Id: id})
if err != nil {
return err
}
return errors.New("not implemented")
}