13497: Proxy requests to Rails API.
[arvados.git] / sdk / go / arvados / config.go
index ca0df1fc907b86ed4bec09b3a05c1697a6295cd4..e0a2b1d28b7422e365250cc7f74ba553ba9c7011 100644 (file)
@@ -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
 }