v1

package
v0.0.0-...-b479636 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusSuccess = "Success"
	StatusFailure = "Failure"
)

Values of Status.Status

View Source
const (
	NamespaceNone string = ""
)
View Source
const WatchEventKind = "WatchEvent"

WatchEventKind is name reserved for serializing watch events.

Variables

This section is empty.

Functions

func AddToGroupVersion

func AddToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)

func DeepCopy_v1_APIResource

func DeepCopy_v1_APIResource(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_APIResource is an autogenerated deepcopy function.

func DeepCopy_v1_APIResourceList

func DeepCopy_v1_APIResourceList(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_APIResourceList is an autogenerated deepcopy function.

func DeepCopy_v1_DeleteOptions

func DeepCopy_v1_DeleteOptions(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_DeleteOptions is an autogenerated deepcopy function.

func DeepCopy_v1_ExportOptions

func DeepCopy_v1_ExportOptions(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_ExportOptions is an autogenerated deepcopy function.

func DeepCopy_v1_GetOptions

func DeepCopy_v1_GetOptions(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_GetOptions is an autogenerated deepcopy function.

func DeepCopy_v1_GroupKind

func DeepCopy_v1_GroupKind(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_GroupKind is an autogenerated deepcopy function.

func DeepCopy_v1_GroupResource

func DeepCopy_v1_GroupResource(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_GroupResource is an autogenerated deepcopy function.

func DeepCopy_v1_GroupVersion

func DeepCopy_v1_GroupVersion(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_GroupVersion is an autogenerated deepcopy function.

func DeepCopy_v1_GroupVersionKind

func DeepCopy_v1_GroupVersionKind(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_GroupVersionKind is an autogenerated deepcopy function.

func DeepCopy_v1_GroupVersionResource

func DeepCopy_v1_GroupVersionResource(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_GroupVersionResource is an autogenerated deepcopy function.

func DeepCopy_v1_LabelSelector

func DeepCopy_v1_LabelSelector(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_LabelSelector is an autogenerated deepcopy function.

func DeepCopy_v1_LabelSelectorRequirement

func DeepCopy_v1_LabelSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_LabelSelectorRequirement is an autogenerated deepcopy function.

func DeepCopy_v1_ListMeta

func DeepCopy_v1_ListMeta(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_ListMeta is an autogenerated deepcopy function.

func DeepCopy_v1_ObjectMeta

func DeepCopy_v1_ObjectMeta(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_ObjectMeta is an autogenerated deepcopy function.

func DeepCopy_v1_Preconditions

func DeepCopy_v1_Preconditions(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_Preconditions is an autogenerated deepcopy function.

func DeepCopy_v1_Status

func DeepCopy_v1_Status(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_Status is an autogenerated deepcopy function.

func DeepCopy_v1_StatusCause

func DeepCopy_v1_StatusCause(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_StatusCause is an autogenerated deepcopy function.

func DeepCopy_v1_StatusDetails

func DeepCopy_v1_StatusDetails(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_StatusDetails is an autogenerated deepcopy function.

func DeepCopy_v1_Time

func DeepCopy_v1_Time(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_Time is an autogenerated deepcopy function.

func DeepCopy_v1_TypeMeta

func DeepCopy_v1_TypeMeta(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_TypeMeta is an autogenerated deepcopy function.

func GetGeneratedDeepCopyFuncs

func GetGeneratedDeepCopyFuncs() []conversion.GeneratedDeepCopyFunc

GetGeneratedDeepCopyFuncs returns the generated funcs, since we aren't registering them.

Types

type APIResource

type APIResource struct {
	// name is the plural name of the resource.
	Name string `json:"name"`
	// singularName is the singular name of the resource.  This allows clients to handle plural and singular opaquely.
	// The singularName is more correct for reporting status on a single item and both singular and plural are allowed
	// from the kubectl CLI interface.
	SingularName string `json:"singularName"`
	// namespaced indicates if a resource is namespaced or not.
	Namespaced bool `json:"namespaced"`
	// kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')
	Kind string `json:"kind"`
	// verbs is a list of supported verbs (this includes get, list, watch, create,
	// update, patch, delete, deletecollection, and proxy)
	Verbs Verbs `json:"verbs"`
	// shortNames is a list of suggested short names of the resource.
	ShortNames []string `json:"shortNames,omitempty"`
	// categories is a list of the grouped resources this resource belongs to (e.g. 'all')
	Categories []string `json:"categories,omitempty"`
}

APIResource specifies the name of a resource and whether it is namespaced.

type APIResourceList

type APIResourceList struct {
	TypeMeta `json:",inline"`
	// groupVersion is the group and version this APIResourceList is for.
	GroupVersion string `json:"groupVersion"`
	// resources contains the name of the resources and if they are namespaced.
	APIResources []APIResource `json:"resources"`
}

APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.

type CauseType

type CauseType string

CauseType is a machine readable value providing more detail about what occurred in a status response. An operation may have multiple causes for a status (whether Failure or Success).

const (
	// CauseTypeFieldValueNotFound is used to report failure to find a requested value
	// (e.g. looking up an ID).
	CauseTypeFieldValueNotFound CauseType = "FieldValueNotFound"
	// CauseTypeFieldValueRequired is used to report required values that are not
	// provided (e.g. empty strings, null values, or empty arrays).
	CauseTypeFieldValueRequired CauseType = "FieldValueRequired"
	// CauseTypeFieldValueDuplicate is used to report collisions of values that must be
	// unique (e.g. unique IDs).
	CauseTypeFieldValueDuplicate CauseType = "FieldValueDuplicate"
	// CauseTypeFieldValueInvalid is used to report malformed values (e.g. failed regex
	// match).
	CauseTypeFieldValueInvalid CauseType = "FieldValueInvalid"
	// CauseTypeFieldValueNotSupported is used to report valid (as per formatting rules)
	// values that can not be handled (e.g. an enumerated string).
	CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
	// CauseTypeUnexpectedServerResponse is used to report when the server responded to the client
	// without the expected return type. The presence of this cause indicates the error may be
	// due to an intervening proxy or the server software malfunctioning.
	CauseTypeUnexpectedServerResponse CauseType = "UnexpectedServerResponse"
)

type DeleteOptions

type DeleteOptions struct {
	TypeMeta `json:",inline"`

	// The duration in seconds before the object should be deleted. Value must be non-negative integer.
	// The value zero indicates delete immediately. If this value is nil, the default grace period for the
	// specified type will be used.
	// Defaults to a per object value if not specified. zero means delete immediately.
	// +optional
	GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty"`

	// Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be
	// returned.
	// +optional
	Preconditions *Preconditions `json:"preconditions,omitempty"`

	// Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7.
	// Should the dependent objects be orphaned. If true/false, the "orphan"
	// finalizer will be added to/removed from the object's finalizers list.
	// Either this field or PropagationPolicy may be set, but not both.
	// +optional
	OrphanDependents *bool `json:"orphanDependents,omitempty"`

	// Whether and how garbage collection will be performed.
	// Either this field or OrphanDependents may be set, but not both.
	// The default policy is decided by the existing finalizer set in the
	// metadata.finalizers and the resource-specific default policy.
	// +optional
	PropagationPolicy *DeletionPropagation `json:"propagationPolicy,omitempty"`
}

DeleteOptions may be provided when deleting an API object.

func NewDeleteOptions

func NewDeleteOptions(grace int64) *DeleteOptions

NewDeleteOptions returns a DeleteOptions indicating the resource should be deleted within the specified grace period. Use zero to indicate immediate deletion. If you would prefer to use the default grace period, use &metav1.DeleteOptions{} directly.

type DeletionPropagation

type DeletionPropagation string

DeletionPropagation decides if a deletion will propagate to the dependents of the object, and how the garbage collector will handle the propagation.

const (
	// Orphans the dependents.
	DeletePropagationOrphan DeletionPropagation = "Orphan"
	// Deletes the object from the key-value store, the garbage collector will
	// delete the dependents in the background.
	DeletePropagationBackground DeletionPropagation = "Background"
	// The object exists in the key-value store until the garbage collector
	// deletes all the dependents whose ownerReference.blockOwnerDeletion=true
	// from the key-value store.  API sever will put the "foregroundDeletion"
	// finalizer on the object, and sets its deletionTimestamp.  This policy is
	// cascading, i.e., the dependents will be deleted with Foreground.
	DeletePropagationForeground DeletionPropagation = "Foreground"
)

type ExportOptions

type ExportOptions struct {
	TypeMeta `json:",inline"`
	// Should this value be exported.  Export strips fields that a user can not specify.
	Export bool `json:"export"`
	// Should the export be exact.  Exact export maintains cluster-specific fields like 'Namespace'.
	Exact bool `json:"exact"`
}

ExportOptions is the query options to the standard REST get call.

type GetOptions

type GetOptions struct {
	TypeMeta `json:",inline"`
	// When specified:
	// - if unset, then the result is returned from remote storage based on quorum-read flag;
	// - if it's 0, then we simply return what we currently have in cache, no guarantee;
	// - if set to non zero, then the result is at least as fresh as given rv.
	ResourceVersion string `json:"resourceVersion,omitempty"`
	// If true, partially initialized resources are included in the response.
	// +optional
	IncludeUninitialized bool `json:"includeUninitialized,omitempty"`
}

GetOptions is the standard query options to the standard REST get call.

type GroupKind

type GroupKind struct {
	Group string `json:"group"`
	Kind  string `json:"kind"`
}

GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types

func (*GroupKind) String

func (gk *GroupKind) String() string

type GroupResource

type GroupResource struct {
	Group    string `json:"group"`
	Resource string `json:"resource"`
}

GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types

func (*GroupResource) String

func (gr *GroupResource) String() string

type GroupVersion

type GroupVersion struct {
	Group   string `json:"group"`
	Version string `json:"version"`
}

GroupVersion contains the "group" and the "version", which uniquely identifies the API.

func (GroupVersion) Empty

func (gv GroupVersion) Empty() bool

Empty returns true if group and version are empty

func (GroupVersion) MarshalJSON

func (gv GroupVersion) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface.

func (GroupVersion) String

func (gv GroupVersion) String() string

String puts "group" and "version" into a single "group/version" string. For the legacy v1 it returns "v1".

func (*GroupVersion) UnmarshalJSON

func (gv *GroupVersion) UnmarshalJSON(value []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

func (*GroupVersion) UnmarshalText

func (gv *GroupVersion) UnmarshalText(value []byte) error

UnmarshalTEXT implements the Ugorji's encoding.TextUnmarshaler interface.

type GroupVersionKind

type GroupVersionKind struct {
	Group   string `json:"group"`
	Version string `json:"version"`
	Kind    string `json:"kind"`
}

GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coersion. It doesn't use a GroupVersion to avoid custom marshalling

+protobuf.options.(gogoproto.goproto_stringer)=false

func (GroupVersionKind) String

func (gvk GroupVersionKind) String() string

type GroupVersionResource

type GroupVersionResource struct {
	Group    string `json:"group"`
	Version  string `json:"version"`
	Resource string `json:"resource"`
}

GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion to avoid automatic coersion. It doesn't use a GroupVersion to avoid custom marshalling

func (*GroupVersionResource) String

func (gvr *GroupVersionResource) String() string

type LabelSelector

type LabelSelector struct {
	// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
	// map is equivalent to an element of matchExpressions, whose key field is "key", the
	// operator is "In", and the values array contains only "value". The requirements are ANDed.
	// +optional
	MatchLabels map[string]string `json:"matchLabels,omitempty"`
	// matchExpressions is a list of label selector requirements. The requirements are ANDed.
	// +optional
	MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty"`
}

A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.

type LabelSelectorOperator

type LabelSelectorOperator string

A label selector operator is the set of operators that can be used in a selector requirement.

const (
	LabelSelectorOpIn           LabelSelectorOperator = "In"
	LabelSelectorOpNotIn        LabelSelectorOperator = "NotIn"
	LabelSelectorOpExists       LabelSelectorOperator = "Exists"
	LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist"
)

type LabelSelectorRequirement

type LabelSelectorRequirement struct {
	// key is the label key that the selector applies to.
	// +patchMergeKey=key
	// +patchStrategy=merge
	Key string `json:"key"`
	// operator represents a key's relationship to a set of values.
	// Valid operators ard In, NotIn, Exists and DoesNotExist.
	Operator LabelSelectorOperator `json:"operator"`
	// values is an array of string values. If the operator is In or NotIn,
	// the values array must be non-empty. If the operator is Exists or DoesNotExist,
	// the values array must be empty. This array is replaced during a strategic
	// merge patch.
	// +optional
	Values []string `json:"values,omitempty"`
}

A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

type List

type List interface {
	GetResourceVersion() string
	SetResourceVersion(version string)
	GetSelfLink() string
	SetSelfLink(selfLink string)
}

List lets you work with list metadata from any of the versioned or internal API objects. Attempting to set or retrieve a field on an object that does not support that field will be a no-op and return a default value. TODO: move this, and TypeMeta and ListMeta, to a different package

type ListMeta

type ListMeta struct {
	// SelfLink is a URL representing this object.
	SelfLink string `json:"selfLink,omitempty"`

	// String that identifies the server's internal version of this object that
	// can be used by clients to determine when objects have changed.
	ResourceVersion string `json:"resourceVersion,omitempty"`
}

ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.

func (*ListMeta) GetListMeta

func (obj *ListMeta) GetListMeta() List

func (*ListMeta) GetResourceVersion

func (meta *ListMeta) GetResourceVersion() string
func (meta *ListMeta) GetSelfLink() string

func (*ListMeta) SetResourceVersion

func (meta *ListMeta) SetResourceVersion(version string)
func (meta *ListMeta) SetSelfLink(selfLink string)

type ListMetaAccessor

type ListMetaAccessor interface {
	GetListMeta() List
}

ListMetaAccessor retrieves the list interface from an object

type Object

type Object interface {
	GetNamespace() string
	SetNamespace(namespace string)
	GetName() string
	SetName(name string)
	GetGenerateName() string
	SetGenerateName(name string)
	GetUID() types.UID
	SetUID(uid types.UID)
	GetResourceVersion() string
	SetResourceVersion(version string)
	GetGeneration() int64
	SetGeneration(generation int64)
	GetSelfLink() string
	SetSelfLink(selfLink string)
	GetCreationTimestamp() Time
	SetCreationTimestamp(timestamp Time)
	GetDeletionTimestamp() *Time
	SetDeletionTimestamp(timestamp *Time)
	GetDeletionGracePeriodSeconds() *int64
	SetDeletionGracePeriodSeconds(*int64)
	GetLabels() map[string]string
	SetLabels(labels map[string]string)
	GetAnnotations() map[string]string
	SetAnnotations(annotations map[string]string)
	// TODO (rantuttl): Do we need this
	//GetInitializers() *Initializers
	//SetInitializers(initializers *Initializers)
	//GetFinalizers() []string
	//SetFinalizers(finalizers []string)
	//GetOwnerReferences() []OwnerReference
	//SetOwnerReferences([]OwnerReference)
	GetClusterName() string
	SetClusterName(clusterName string)
}

Object lets you work with object metadata from any of the versioned or internal API objects. Attempting to set or retrieve a field on an object that does not support that field (Name, UID, Namespace on lists) will be a no-op and return a default value.

type ObjectMeta

type ObjectMeta struct {
	// Name must be unique. Is required when creating resources, although some resources
	// may allow a client to request the generation of an appropriate name automatically.
	// Name is primarily intended for creation idempotence and configuration definition.
	Name string `json:"name,omitempty"`

	// GenerateName is an optional prefix, used by the server, to generate a unique
	// name ONLY IF the Name field has not been provided.
	GenerateName string `json:"generateName,omitempty"`

	// Namespace defines the space within each name must be unique. An empty namespace is
	// equivalent to the "default" namespace, but "default" is the canonical representation.
	// Not all objects are required to be scoped to a namespace - the value of this field for
	// those objects will be empty.
	Namespace string `json:"namespace,omitempty"`

	// SelfLink is a URL representing this object.
	SelfLink string `json:"selfLink,omitempty"`

	// UID is the unique in time and space value for this object. It is typically generated by
	// the server on successful creation of a resource and is not allowed to change on PUT
	// operations.
	UID types.UID `json:"uid,omitempty"`

	// String that identifies the server's internal version of this object that
	// can be used by clients to determine when objects have changed.
	ResourceVersion string `json:"resourceVersion,omitempty"`

	// A sequence number representing a specific generation of the desired state.
	Generation int64 `json:"generation,omitempty"`

	// CreationTimestamp is a timestamp representing the server time when this object was
	// created. It is not guaranteed to be set in happens-before order across separate operations.
	// Clients may not set this value. It is represented in RFC3339 form and is in UTC.
	CreationTimestamp Time `json:"creationTimestamp,omitempty"`

	// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This
	// field is set by the server when a graceful deletion is requested by the user, and is not
	// directly settable by a client.
	DeletionTimestamp *Time `json:"deletionTimestamp,omitempty"`

	// Number of seconds allowed for this object to gracefully terminate before
	// it will be removed from the system. Only set when deletionTimestamp is also set.
	DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"`

	// Map of string keys and values that can be used to organize and categorize
	// (scope and select) objects.
	Labels map[string]string `json:"labels,omitempty"`

	// Annotations is an unstructured key value map stored with a resource that may be
	// set by external tools to store and retrieve arbitrary metadata.
	Annotations map[string]string `json:"annotations,omitempty"`

	// The name of the cluster which the object belongs to. This is used to distinguish
	// resources with same name and namespace in different clusters.
	ClusterName string `json:"clusterName,omitempty"`
}

ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.

func (*ObjectMeta) GetAnnotations

func (meta *ObjectMeta) GetAnnotations() map[string]string

func (*ObjectMeta) GetClusterName

func (meta *ObjectMeta) GetClusterName() string

func (*ObjectMeta) GetCreationTimestamp

func (meta *ObjectMeta) GetCreationTimestamp() Time

func (*ObjectMeta) GetDeletionGracePeriodSeconds

func (meta *ObjectMeta) GetDeletionGracePeriodSeconds() *int64

func (*ObjectMeta) GetDeletionTimestamp

func (meta *ObjectMeta) GetDeletionTimestamp() *Time

func (*ObjectMeta) GetGenerateName

func (meta *ObjectMeta) GetGenerateName() string

func (*ObjectMeta) GetGeneration

func (meta *ObjectMeta) GetGeneration() int64

func (*ObjectMeta) GetLabels

func (meta *ObjectMeta) GetLabels() map[string]string

func (*ObjectMeta) GetName

func (meta *ObjectMeta) GetName() string

func (*ObjectMeta) GetNamespace

func (meta *ObjectMeta) GetNamespace() string

Namespace implements metav1.Object for any object with an ObjectMeta typed field. Allows fast, direct access to metadata fields for API objects.

func (*ObjectMeta) GetObjectMeta

func (obj *ObjectMeta) GetObjectMeta() Object

func (*ObjectMeta) GetResourceVersion

func (meta *ObjectMeta) GetResourceVersion() string
func (meta *ObjectMeta) GetSelfLink() string

func (*ObjectMeta) GetUID

func (meta *ObjectMeta) GetUID() types.UID

func (*ObjectMeta) SetAnnotations

func (meta *ObjectMeta) SetAnnotations(annotations map[string]string)

func (*ObjectMeta) SetClusterName

func (meta *ObjectMeta) SetClusterName(clusterName string)

func (*ObjectMeta) SetCreationTimestamp

func (meta *ObjectMeta) SetCreationTimestamp(creationTimestamp Time)

func (*ObjectMeta) SetDeletionGracePeriodSeconds

func (meta *ObjectMeta) SetDeletionGracePeriodSeconds(deletionGracePeriodSeconds *int64)

func (*ObjectMeta) SetDeletionTimestamp

func (meta *ObjectMeta) SetDeletionTimestamp(deletionTimestamp *Time)

func (*ObjectMeta) SetGenerateName

func (meta *ObjectMeta) SetGenerateName(generateName string)

func (*ObjectMeta) SetGeneration

func (meta *ObjectMeta) SetGeneration(generation int64)

func (*ObjectMeta) SetLabels

func (meta *ObjectMeta) SetLabels(labels map[string]string)

func (*ObjectMeta) SetName

func (meta *ObjectMeta) SetName(name string)

func (*ObjectMeta) SetNamespace

func (meta *ObjectMeta) SetNamespace(namespace string)

func (*ObjectMeta) SetResourceVersion

func (meta *ObjectMeta) SetResourceVersion(version string)
func (meta *ObjectMeta) SetSelfLink(selfLink string)

func (*ObjectMeta) SetUID

func (meta *ObjectMeta) SetUID(uid types.UID)

type ObjectMetaAccessor

type ObjectMetaAccessor interface {
	GetObjectMeta() Object
}

TODO: move this, Object, List, and Type to a different package

type Preconditions

type Preconditions struct {
	// Specifies the target UID.
	// +optional
	UID *types.UID `json:"uid,omitempty"`
}

Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.

type Status

type Status struct {
	TypeMeta `json:",inline"`
	// Standard list metadata.
	// +optional
	ListMeta `json:"metadata,omitempty"`

	// Status of the operation.
	// One of: "Success" or "Failure".
	// +optional
	Status string `json:"status,omitempty"`
	// A human-readable description of the status of this operation.
	// +optional
	Message string `json:"message,omitempty"`
	// A machine-readable description of why this operation is in the
	// "Failure" status. If this value is empty there
	// is no information available. A Reason clarifies an HTTP status
	// code but does not override it.
	// +optional
	Reason StatusReason `json:"reason,omitempty"`
	// Extended data associated with the reason.  Each reason may define its
	// own extended details. This field is optional and the data returned
	// is not guaranteed to conform to any schema except that defined by
	// the reason type.
	// +optional
	Details *StatusDetails `json:"details,omitempty"`
	// Suggested HTTP return code for this status, 0 if not set.
	// +optional
	Code int32 `json:"code,omitempty"`
}

Status is a return value for calls that don't return other objects.

type StatusCause

type StatusCause struct {
	// A machine-readable description of the cause of the error. If this value is
	// empty there is no information available.
	// +optional
	Type CauseType `json:"reason,omitempty"`
	// A human-readable description of the cause of the error.  This field may be
	// presented as-is to a reader.
	// +optional
	Message string `json:"message,omitempty"`
	// The field of the resource that has caused this error, as named by its JSON
	// serialization. May include dot and postfix notation for nested attributes.
	// Arrays are zero-indexed.  Fields may appear more than once in an array of
	// causes due to fields having multiple errors.
	// Optional.
	//
	// Examples:
	//   "name" - the field "name" on the current resource
	//   "items[0].name" - the field "name" on the first array entry in "items"
	// +optional
	Field string `json:"field,omitempty"`
}

StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.

type StatusDetails

type StatusDetails struct {
	// The name attribute of the resource associated with the status StatusReason
	// (when there is a single name which can be described).
	// +optional
	Name string `json:"name,omitempty"`
	// The group attribute of the resource associated with the status StatusReason.
	// +optional
	Group string `json:"group,omitempty"`
	// The kind attribute of the resource associated with the status StatusReason.
	// On some operations may differ from the requested resource Kind.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	Kind string `json:"kind,omitempty"`
	// UID of the resource.
	// (when there is a single resource which can be described).
	// More info: http://kubernetes.io/docs/user-guide/identifiers#uids
	// +optional
	UID types.UID `json:"uid,omitempty"`
	// The Causes array includes more details associated with the StatusReason
	// failure. Not all StatusReasons may provide detailed causes.
	// +optional
	Causes []StatusCause `json:"causes,omitempty"`
	// If specified, the time in seconds before the operation should be retried.
	// +optional
	RetryAfterSeconds int32 `json:"retryAfterSeconds,omitempty"`
}

StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.

type StatusReason

type StatusReason string

StatusReason is an enumeration of possible failure causes. Each StatusReason must map to a single HTTP status code, but multiple reasons may map to the same HTTP status code.

const (
	// StatusReasonUnknown means the server has declined to indicate a specific reason.
	// The details field may contain other information about this error.
	// Status code 500.
	StatusReasonUnknown StatusReason = ""

	// StatusReasonUnauthorized means the server can be reached and understood the request, but requires
	// the user to present appropriate authorization credentials (identified by the WWW-Authenticate header)
	// in order for the action to be completed. If the user has specified credentials on the request, the
	// server considers them insufficient.
	// Status code 401
	StatusReasonUnauthorized StatusReason = "Unauthorized"

	// StatusReasonForbidden means the server can be reached and understood the request, but refuses
	// to take any further action.  It is the result of the server being configured to deny access for some reason
	// to the requested resource by the client.
	// Details (optional):
	//   "kind" string - the kind attribute of the forbidden resource
	//		   on some operations may differ from the requested
	//		   resource.
	//   "id"   string - the identifier of the forbidden resource
	// Status code 403
	StatusReasonForbidden StatusReason = "Forbidden"

	// StatusReasonNotFound means one or more resources required for this operation
	// could not be found.
	// Details (optional):
	//   "kind" string - the kind attribute of the missing resource
	//		   on some operations may differ from the requested
	//		   resource.
	//   "id"   string - the identifier of the missing resource
	// Status code 404
	StatusReasonNotFound StatusReason = "NotFound"

	// StatusReasonAlreadyExists means the resource you are creating already exists.
	// Details (optional):
	//   "kind" string - the kind attribute of the conflicting resource
	//   "id"   string - the identifier of the conflicting resource
	// Status code 409
	StatusReasonAlreadyExists StatusReason = "AlreadyExists"

	// StatusReasonConflict means the requested operation cannot be completed
	// due to a conflict in the operation. The client may need to alter the
	// request. Each resource may define custom details that indicate the
	// nature of the conflict.
	// Status code 409
	StatusReasonConflict StatusReason = "Conflict"

	// StatusReasonGone means the item is no longer available at the server and no
	// forwarding address is known.
	// Status code 410
	StatusReasonGone StatusReason = "Gone"

	// StatusReasonInvalid means the requested create or update operation cannot be
	// completed due to invalid data provided as part of the request. The client may
	// need to alter the request. When set, the client may use the StatusDetails
	// message field as a summary of the issues encountered.
	// Details (optional):
	//   "kind" string - the kind attribute of the invalid resource
	//   "id"   string - the identifier of the invalid resource
	//   "causes"      - one or more StatusCause entries indicating the data in the
	//		   provided resource that was invalid.  The code, message, and
	StatusReasonInvalid StatusReason = "Invalid"

	// StatusReasonServerTimeout means the server can be reached and understood the request,
	// but cannot complete the action in a reasonable time. The client should retry the request.
	// This is may be due to temporary server load or a transient communication issue with
	// another server. Status code 500 is used because the HTTP spec provides no suitable
	// server-requested client retry and the 5xx class represents actionable errors.
	// Details (optional):
	//   "kind" string - the kind attribute of the resource being acted on.
	//   "id"   string - the operation that is being attempted.
	//   "retryAfterSeconds" int32 - the number of seconds before the operation should be retried
	// Status code 500
	StatusReasonServerTimeout StatusReason = "ServerTimeout"

	// StatusReasonTimeout means that the request could not be completed within the given time.
	// Clients can get this response only when they specified a timeout param in the request,
	// or if the server cannot complete the operation within a reasonable amount of time.
	// The request might succeed with an increased value of timeout param. The client *should*
	// wait at least the number of seconds specified by the retryAfterSeconds field.
	// Details (optional):
	//   "retryAfterSeconds" int32 - the number of seconds before the operation should be retried
	// Status code 504
	StatusReasonTimeout StatusReason = "Timeout"

	// StatusReasonBadRequest means that the request itself was invalid, because the request
	// doesn't make any sense, for example deleting a read-only object.  This is different than
	// StatusReasonInvalid above which indicates that the API call could possibly succeed, but the
	// data was invalid.  API calls that return BadRequest can never succeed.
	StatusReasonBadRequest StatusReason = "BadRequest"

	// StatusReasonMethodNotAllowed means that the action the client attempted to perform on the
	// resource was not supported by the code - for instance, attempting to delete a resource that
	// can only be created. API calls that return MethodNotAllowed can never succeed.
	StatusReasonMethodNotAllowed StatusReason = "MethodNotAllowed"

	// StatusReasonInternalError indicates that an internal error occurred, it is unexpected
	// and the outcome of the call is unknown.
	// Details (optional):
	//   "causes" - The original error
	// Status code 500
	StatusReasonInternalError StatusReason = "InternalError"

	// StatusReasonExpired indicates that the request is invalid because the content you are requesting
	// has expired and is no longer available. It is typically associated with watches that can't be
	// serviced.
	// Status code 410 (gone)
	StatusReasonExpired StatusReason = "Expired"

	// StatusReasonServiceUnavailable means that the request itself was valid,
	// but the requested service is unavailable at this time.
	// Retrying the request after some time might succeed.
	// Status code 503
	StatusReasonServiceUnavailable StatusReason = "ServiceUnavailable"
)

type Time

type Time struct {
	time.Time `json:"-"`
}

func Date

func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time

Date returns the Time corresponding to the supplied parameters by wrapping time.Date.

func NewTime

func NewTime(time time.Time) Time

NewTime returns a wrapped instance of the provided time

func Now

func Now() Time

Now returns the current local time.

func (Time) Before

func (t Time) Before(u Time) bool

Before reports whether the time instant t is before u.

func (Time) DeepCopy

func (t Time) DeepCopy() Time

func (Time) Equal

func (t Time) Equal(u Time) bool

Equal reports whether the time instant t is equal to u.

func (*Time) IsZero

func (t *Time) IsZero() bool

IsZero returns true if the value is nil or time is zero.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Time) MarshalQueryParameter

func (t Time) MarshalQueryParameter() (string, error)

MarshalQueryParameter converts to a URL query parameter value

func (Time) String

func (t Time) String() string

String returns the representation of the time.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

func (*Time) UnmarshalQueryParameter

func (t *Time) UnmarshalQueryParameter(str string) error

UnmarshalQueryParameter converts from a URL query parameter value to an object

type Type

type Type interface {
	GetAPIVersion() string
	SetAPIVersion(version string)
	GetKind() string
	SetKind(kind string)
}

Type exposes the type and APIVersion of versioned or internal API objects. TODO: move this, and TypeMeta and ListMeta, to a different package

type TypeMeta

type TypeMeta struct {
	// Kind is a string value representing the REST resource this object represents.
	Kind string `json:"kind,omitempty"`

	// APIVersion defines the versioned schema of this representation of an object.
	APIVersion string `json:"apiVersion,omitempty"`
}

TypeMeta describes an individual object in an API response or request with strings representing the type of the object and its API schema version. Structures that are versioned or persisted should inline TypeMeta.

func (*TypeMeta) GetObjectKind

func (obj *TypeMeta) GetObjectKind() schema.ObjectKind

func (*TypeMeta) GroupVersionKind

func (obj *TypeMeta) GroupVersionKind() schema.GroupVersionKind

GroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta

func (*TypeMeta) SetGroupVersionKind

func (obj *TypeMeta) SetGroupVersionKind(gvk schema.GroupVersionKind)

SetGroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta

type Verbs

type Verbs []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL