Esempio n. 1
0
	"github.com/aws/aws-sdk-go/aws/credentials"
	"github.com/koding/logging"

	"koding/kites/kloud/pkg/dnsclient"
	"koding/kites/kloud/utils/res"
)

var (
	accessKey  = os.Getenv("ROUTE53_ACCESS_KEY")
	secretKey  = os.Getenv("ROUTE53_SECRET_KEY")
	hostedZone = os.Getenv("ROUTE53_HOSTED_ZONE")

	client *dnsclient.Route53
)

var Resources = res.New("route53")

func init() {
	Resources.Register(recordsResource)
}

func die(v interface{}) {
	fmt.Fprintln(os.Stderr, v)
	os.Exit(1)
}

func main() {
	if accessKey == "" {
		die("AWS_ACCESS_KEY is not set")
	}
	if secretKey == "" {
Esempio n. 2
0
	"fmt"
	"os"

	"koding/kites/kloud/api/sl"
	"koding/kites/kloud/utils/res"
)

var (
	username = os.Getenv("SOFTLAYER_USER_NAME")
	apiKey   = os.Getenv("SOFTLAYER_API_KEY")

	client *sl.Softlayer
)

// Resources var is used to globally register each Softlayer resources handler.
var Resources = res.New("sl")

func die(v interface{}) {
	fmt.Fprintln(os.Stderr, v)
	os.Exit(1)
}

func main() {
	if username == "" {
		die("SOFTLAYER_USER_NAME is not set")
	}
	if apiKey == "" {
		die("SOFTLAYER_API_KEY is not set")
	}
	client = sl.NewSoftlayer(username, apiKey)
	if err := Resources.Main(os.Args[1:]); err != nil {