Documentation ¶
Overview ¶
Copyright 2017 The Kubernetes Authors All rights reserved.
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.
Index ¶
- func ConvertToAPICondition(condition types.Condition) v1.NodeCondition
- func ConvertToAPIConditionStatus(status types.ConditionStatus) v1.ConditionStatus
- func ConvertToAPIEventType(severity types.Severity) string
- func ConvertToAPITimestamp(timestamp time.Time) metav1.Time
- func GenerateConditionChangeEvent(t string, status types.ConditionStatus, reason string, timestamp time.Time) types.Event
- func GetOSVersion() (string, error)
- func GetStartTime(now time.Time, uptimeDuration time.Duration, lookbackStr string, ...) (time.Time, error)
- func GetUptimeDuration() (time.Duration, error)
- func ReturnHTTPError(w http.ResponseWriter, err error)
- func ReturnHTTPJson(w http.ResponseWriter, object interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToAPICondition ¶
func ConvertToAPICondition(condition types.Condition) v1.NodeCondition
ConvertToAPICondition converts the internal node condition to v1.NodeCondition.
func ConvertToAPIConditionStatus ¶
func ConvertToAPIConditionStatus(status types.ConditionStatus) v1.ConditionStatus
ConvertToAPIConditionStatus converts the internal node condition status to v1.ConditionStatus.
func ConvertToAPIEventType ¶
ConvertToAPIEventType converts the internal severity to event type.
func ConvertToAPITimestamp ¶
ConvertToAPITimestamp converts the timestamp to metav1.Time
func GenerateConditionChangeEvent ¶ added in v0.5.0
func GenerateConditionChangeEvent(t string, status types.ConditionStatus, reason string, timestamp time.Time) types.Event
GenerateConditionChangeEvent generates an event for condition change.
func GetOSVersion ¶ added in v0.7.0
GetOSVersion retrieves the version of the current operating system. For example: "cos 77-12293.0.0", "ubuntu 16.04.6 LTS (Xenial Xerus)".
func GetStartTime ¶ added in v0.6.0
func GetUptimeDuration ¶ added in v0.6.0
func ReturnHTTPError ¶ added in v0.3.0
func ReturnHTTPError(w http.ResponseWriter, err error)
ReturnHTTPError generates error http response.
func ReturnHTTPJson ¶ added in v0.3.0
func ReturnHTTPJson(w http.ResponseWriter, object interface{})
ReturnHTTPJson generates json http response.
Types ¶
This section is empty.