Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/gitpod-cli/pkg/supervisor/ports.go
2500 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package supervisor
6
7
import (
8
"context"
9
10
"github.com/gitpod-io/gitpod/supervisor/api"
11
)
12
13
func (client *SupervisorClient) GetPortsList(ctx context.Context) ([]*api.PortsStatus, error) {
14
portsStatusClient, portsStatusClientError := client.Status.PortsStatus(ctx, &api.PortsStatusRequest{Observe: false})
15
16
if portsStatusClientError != nil {
17
return nil, portsStatusClientError
18
}
19
20
portsStatusResponse, portsStatusResponseError := portsStatusClient.Recv()
21
22
if portsStatusResponseError != nil {
23
return nil, portsStatusResponseError
24
}
25
26
return portsStatusResponse.GetPorts(), nil
27
}
28
29