// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package execute

import (
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("execute")
// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package event

import (
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("event")

const (
	// No Captial is allowed in index name
	indexKubernetesEventIndex = "kubernetes_event"
)
// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cluster

import (
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("cluster")

const (
	// No Captial is allowed in index name
	indexClusterSingletonLock = "indexclustersingletonlock"

	typeCloudoneAnalysis = "cloudone_analysis"
)
// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package audit

import (
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("audit")

const (
	// No Captial is allowed in index name
	indexAuditLogIndex = "audit_log"
)
// See the License for the specific language governing permissions and
// limitations under the License.

package configuration

import (
	"errors"
	analysisLogger "github.com/cloudawan/cloudone_analysis/utility/logger"
	"github.com/cloudawan/cloudone_utility/configuration"
	"github.com/cloudawan/cloudone_utility/logger"
	"github.com/cloudawan/cloudone_utility/restclient"
	"io/ioutil"
	"time"
)

var log = analysisLogger.GetLogManager().GetLogger("utility")

var configurationContent = `
{
	"certificate": "/etc/cloudone_analysis/development_cert.pem",
	"key": "/etc/cloudone_analysis/development_key.pem",
	"restapiPort": 8082,
	"elasticsearchHost": ["127.0.0.1"],
	"elasticsearchPort": 9200,
	"kubeApiServerEndPoints": ["https://kubernetes.default.svc.cluster.local:443"],
	"kubeApiServerHealthCheckTimeoutInMilliSecond": 1000,
	"kubeApiServerTokenPath": "/var/run/secrets/kubernetes.io/serviceaccount/token",
	"singletonLockTimeoutInMilliSecond": 5000,
	"singletonLockWaitingAfterBeingCandidateInMilliSecond": 5000,
	"cloudoneProtocol": "https",
	"cloudoneHost": "127.0.0.1",
// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package restapi

import (
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("restapi")
// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package build

import (
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("build")

const (
	// No Captial is allowed in index name
	indexBuildLogIndexPrefix = "build_log_"
	indexBuildLogType        = "build_log"
)
Exemple #8
0
// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package main

import (
	"github.com/cloudawan/cloudone_analysis/execute"
	"github.com/cloudawan/cloudone_analysis/restapi"
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("default")

func main() {
	restapi.StartRestAPIServer()
	restapi.Close()
	execute.Close()
}
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package elasticsearch

import (
	"github.com/cloudawan/cloudone_analysis/utility/configuration"
	"github.com/cloudawan/cloudone_analysis/utility/logger"
	"github.com/cloudawan/cloudone_utility/database/elasticsearch"
)

var log = logger.GetLogManager().GetLogger("utility")

var ElasticSearchClient *elasticsearch.ElasticSearchClient

func init() {
	elasticsearchHost, ok := configuration.LocalConfiguration.GetStringSlice("elasticsearchHost")
	if ok == false {
		log.Critical("Can't load elasticsearchHost")
		panic("Can't load elasticsearchHost")
	}

	elasticsearchPort, ok := configuration.LocalConfiguration.GetInt("elasticsearchPort")
	if ok == false {
		log.Critical("Can't load elasticsearchPort")
		panic("Can't load elasticsearchPort")
	}
// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package monitor

import (
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("monitor")

const (
	// No Captial is allowed in index name
	indexContainerMetricsIndexPrefix = "indexcontainermetrics_"
	indexContainerMetricsTypePrefix  = "typereplicationcontroller_"
)
// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package control

import (
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("control")
// Copyright 2015 CloudAwan LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package healthcheck

import (
	"github.com/cloudawan/cloudone_analysis/utility/logger"
)

var log = logger.GetLogManager().GetLogger("healthcheck")