X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4b4458cfb9dbc2f80ab819efcb1533fcff8f6503..36f8e449321e4fa02d88fee1fded14aa8ff81723:/sdk/go/arvados/config.go diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go index ca0df1fc90..e0a2b1d28b 100644 --- a/sdk/go/arvados/config.go +++ b/sdk/go/arvados/config.go @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + package arvados import ( @@ -48,6 +52,16 @@ type Cluster struct { ClusterID string `json:"-"` ManagementToken string SystemNodes map[string]SystemNode + InstanceTypes []InstanceType +} + +type InstanceType struct { + Name string + ProviderType string + VCPUs int + RAM int64 + Scratch int64 + Price float64 } // GetThisSystemNode returns a SystemNode for the node we're running @@ -76,6 +90,7 @@ func (cc *Cluster) GetSystemNode(node string) (*SystemNode, error) { } type SystemNode struct { + Controller SystemServiceInstance `json:"arvados-controller"` Health SystemServiceInstance `json:"arvados-health"` Keepproxy SystemServiceInstance `json:"keepproxy"` Keepstore SystemServiceInstance `json:"keepstore"` @@ -86,20 +101,35 @@ type SystemNode struct { Workbench SystemServiceInstance `json:"arvados-workbench"` } +type ServiceName string + +const ( + ServiceNameRailsAPI ServiceName = "arvados-api-server" + ServiceNameController ServiceName = "arvados-controller" + ServiceNameNodemanager ServiceName = "arvados-node-manager" + ServiceNameWorkbench ServiceName = "arvados-workbench" + ServiceNameWebsocket ServiceName = "arvados-ws" + ServiceNameKeepweb ServiceName = "keep-web" + ServiceNameKeepproxy ServiceName = "keepproxy" + ServiceNameKeepstore ServiceName = "keepstore" +) + // ServicePorts returns the configured listening address (or "" if // disabled) for each service on the node. -func (sn *SystemNode) ServicePorts() map[string]string { - return map[string]string{ - "arvados-api-server": sn.RailsAPI.Listen, - "arvados-node-manager": sn.Nodemanager.Listen, - "arvados-workbench": sn.Workbench.Listen, - "arvados-ws": sn.Websocket.Listen, - "keep-web": sn.Keepweb.Listen, - "keepproxy": sn.Keepproxy.Listen, - "keepstore": sn.Keepstore.Listen, +func (sn *SystemNode) ServicePorts() map[ServiceName]string { + return map[ServiceName]string{ + ServiceNameRailsAPI: sn.RailsAPI.Listen, + ServiceNameController: sn.Controller.Listen, + ServiceNameNodemanager: sn.Nodemanager.Listen, + ServiceNameWorkbench: sn.Workbench.Listen, + ServiceNameWebsocket: sn.Websocket.Listen, + ServiceNameKeepweb: sn.Keepweb.Listen, + ServiceNameKeepproxy: sn.Keepproxy.Listen, + ServiceNameKeepstore: sn.Keepstore.Listen, } } type SystemServiceInstance struct { Listen string + TLS bool }