-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproperties.go
35 lines (28 loc) · 874 Bytes
/
properties.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2020 Steve Jones
// SPDX-License-Identifier: BSD-2-Clause
package cmd
import (
"github.com/sjones4/eucalyptus-sdk-go/service/euprop"
"github.com/spf13/cobra"
)
const (
PropertiesDnsLabel = "properties"
DefaultPropertiesEndpoint = "http://127.0.0.1:8773/services/Properties"
EnvPropertiesServiceUrl = "EUCA_PROPERTIES_URL"
)
// propertiesCmd is the parent for all properties service commands
var propertiesCmd = &cobra.Command{
Use: "properties",
Short: "Eucalyptus cloud properties service",
}
func init() {
rootCmd.AddCommand(propertiesCmd)
}
func GetPropertiesEndpoint() string {
return GetEndpoint(EnvPropertiesServiceUrl, PropertiesDnsLabel, DefaultPropertiesEndpoint)
}
func GetPropertiesSvc() *euprop.Client {
propertiesEndpoint := GetPropertiesEndpoint()
cfg := GetAwsConfig(propertiesEndpoint)
return euprop.New(cfg)
}