Documentation
¶
Index ¶
- type CreateOpts
- type DeleteBody
- type DeleteOpts
- type DeleteResult
- type ListMeta
- type ListOpts
- type ManagedFieldsEntry
- type Metadata
- type Namespace
- type NamespaceCondition
- type NamespacePage
- type NamespaceSpec
- type NamespaceStatus
- type OwnerReference
- type Preconditions
- type StatusCause
- type StatusDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateOpts ¶
type CreateOpts struct {
// APIVersion defines the versioned schema of this representation of an object
APIVersion string `json:"apiVersion,omitempty"`
// Kind is a string value representing the REST resource this object represents
Kind string `json:"kind,omitempty"`
// Metadata contains the namespace metadata
Metadata Metadata `json:"metadata" required:"true"`
// Spec defines the behavior of the Namespace
Spec *NamespaceSpec `json:"spec,omitempty"`
// Status describes the current status of a Namespace
Status *NamespaceStatus `json:"status,omitempty"`
}
CreateOpts contains the options for creating a new namespace
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*CreateOpts, error)
Create requests the creation of a new namespace
type DeleteBody ¶
type DeleteBody struct {
// APIVersion defines the versioned schema
APIVersion string `json:"apiVersion,omitempty"`
// Kind represents the REST resource
Kind string `json:"kind,omitempty"`
// GracePeriodSeconds is the duration in seconds before deletion
GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty"`
// PropagationPolicy determines how garbage collection will be performed
PropagationPolicy string `json:"propagationPolicy,omitempty"`
// DryRun when present, indicates modifications should not be persisted
DryRun []string `json:"dryRun,omitempty"`
// OrphanDependents determines if dependent objects should be orphaned
OrphanDependents *bool `json:"orphanDependents,omitempty"`
// Preconditions must be fulfilled before deletion
Preconditions *Preconditions `json:"preconditions,omitempty"`
}
DeleteBody represents the body of delete request
type DeleteOpts ¶
type DeleteOpts struct {
// Name of the namespace to delete
Name string `json:"-" required:"true"`
// Body contains the delete options
Body DeleteBody `json:"-" required:"true"`
}
DeleteOpts contains all the values needed to delete a namespace
type DeleteResult ¶
type DeleteResult struct {
// APIVersion of the response
APIVersion string `json:"apiVersion,omitempty"`
// Kind of the response
Kind string `json:"kind,omitempty"`
// Status of the operation: Success or Failure
Status *NamespaceStatus `json:"status"`
// Message provides human-readable description
Message string `json:"message,omitempty"`
// Code represents the HTTP status code
Code int `json:"code,omitempty"`
// Reason provides machine-readable description for Failure status
Reason string `json:"reason,omitempty"`
// Details provides additional information
Details *StatusDetails `json:"details,omitempty"`
// Metadata contains list metadata
Metadata ListMeta `json:"metadata,omitempty"`
// Spec defines the behavior of the Namespace
Spec *NamespaceSpec `json:"spec,omitempty"`
}
DeleteResult represents the API response after deletion
func Delete ¶
func Delete(client *golangsdk.ServiceClient, opts DeleteOpts) (*DeleteResult, error)
Delete removes a namespace with specified options
type ListMeta ¶
type ListMeta struct {
// Continue may be set if the user set a limit on the number of items returned
Continue string `json:"continue,omitempty"`
// RemainingItemCount is the number of subsequent items in the list which are not included
RemainingItemCount *int64 `json:"remainingItemCount,omitempty"`
// ResourceVersion is an opaque value that allows clients to determine when objects have changed
ResourceVersion string `json:"resourceVersion,omitempty"`
// SelfLink is a URL representing this object
SelfLink string `json:"selfLink,omitempty"`
}
ListMeta represents metadata that is required for paginated list responses
type ListOpts ¶
type ListOpts struct {
// AllowWatchBookmarks requests watch events with type "BOOKMARK"
AllowWatchBookmarks *bool `q:"allowWatchBookmarks,omitempty"`
// The continue option should be set when retrieving more results from the server
Continue string `q:"continue,omitempty"`
// A selector to restrict the list of returned objects by their fields
FieldSelector string `q:"fieldSelector,omitempty"`
// A selector to restrict the list of returned objects by their labels
LabelSelector string `q:"labelSelector,omitempty"`
// Limit is a maximum number of responses to return for a list call
Limit *int `q:"limit,omitempty"`
// ResourceVersion sets a constraint on what resource versions a request may be served from
ResourceVersion string `q:"resourceVersion,omitempty"`
// ResourceVersionMatch determines how resourceVersion is applied to list calls
ResourceVersionMatch string `q:"resourceVersionMatch,omitempty"`
// SendInitialEvents when set together with Watch option
SendInitialEvents *bool `q:"sendInitialEvents,omitempty"`
// Timeout for the list/watch call
TimeoutSeconds *int `q:"timeoutSeconds,omitempty"`
// Watch for changes to the described resources
Watch *bool `q:"watch,omitempty"`
// If 'true', then the output is pretty printed
Pretty *bool `q:"pretty,omitempty"`
}
ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the corresponding query parameters.
type ManagedFieldsEntry ¶
type ManagedFieldsEntry struct {
// APIVersion defines the version of this resource that this field set applies to
APIVersion string `json:"apiVersion,omitempty"`
// FieldsType is the discriminator for the different fields format and version
FieldsType string `json:"fieldsType,omitempty"`
// FieldsV1 holds the first JSON version format
FieldsV1 interface{} `json:"fieldsV1,omitempty"`
// Manager is an identifier of the workflow managing these fields
Manager string `json:"manager,omitempty"`
// Operation is the type of operation which lead to this ManagedFieldsEntry being created
Operation string `json:"operation,omitempty"`
// Time is timestamp of when these fields were set
Time string `json:"time,omitempty"`
}
ManagedFieldsEntry contains information about fields managed by controllers
type Metadata ¶
type Metadata struct {
// Name must be unique within a namespace
Name string `json:"name,omitempty"`
// Annotations is an unstructured key value map stored with a resource
Annotations map[string]string `json:"annotations,omitempty"`
// Labels contains map of string keys and values
Labels map[string]string `json:"labels,omitempty"`
// ClusterName is the name of the cluster which the object belongs to
ClusterName string `json:"clusterName,omitempty"`
// CreationTimestamp is a timestamp representing the server time when this object was created
CreationTimestamp string `json:"creationTimestamp,omitempty"`
// DeletionGracePeriodSeconds is the duration in seconds before the object should be deleted
DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"`
// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
// Enable identifies whether the resource is available
Enable *bool `json:"enable,omitempty"`
// Finalizers must be empty before the object is deleted from the registry
Finalizers []string `json:"finalizers,omitempty"`
// GenerateName is an optional prefix for generated names
GenerateName string `json:"generateName,omitempty"`
// Generation is a sequence number representing a specific generation of the desired state
Generation *int64 `json:"generation,omitempty"`
// ManagedFields contains info managed by controllers
ManagedFields []ManagedFieldsEntry `json:"managedFields,omitempty"`
// Namespace defines the space within which each name must be unique
Namespace string `json:"namespace,omitempty"`
// OwnerReferences contains the list of objects depended by this object
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
// ResourceVersion is an opaque value that represents the internal version of this object
ResourceVersion string `json:"resourceVersion,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
UID string `json:"uid,omitempty"`
}
Metadata contains the metadata for the namespace
type Namespace ¶
type Namespace struct {
// APIVersion defines the versioned schema of this representation of an object
APIVersion string `json:"apiVersion"`
// Kind is a string value representing the REST resource this object represents
Kind string `json:"kind"`
// Metadata contains the namespace metadata
Metadata Metadata `json:"metadata"`
// Spec defines the behavior of the Namespace
Spec NamespaceSpec `json:"spec"`
// Status describes the current status of a Namespace
Status NamespaceStatus `json:"status"`
}
Namespace represents the response structure for namespace operations
func ExtractNamespaces ¶
func ExtractNamespaces(r pagination.NewPage) ([]Namespace, error)
ExtractNamespaces accepts a Page struct, specifically a NamespacePage struct, and extracts the elements into a slice of Namespace structs.
type NamespaceCondition ¶
type NamespaceCondition struct {
// Type of namespace controller condition
Type string `json:"type" required:"true"`
// Status of the condition, one of True, False, Unknown
Status string `json:"status" required:"true"`
// Last transition time
LastTransitionTime string `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition
Message string `json:"message,omitempty"`
}
NamespaceCondition contains details for the current condition of this namespace
type NamespacePage ¶
type NamespacePage struct {
pagination.NewSinglePageBase
}
NamespacePage is the page returned by a pager when traversing over a collection of namespaces.
type NamespaceSpec ¶
type NamespaceSpec struct {
// Finalizers is an opaque list of values that must be empty to permanently remove object from storage
Finalizers []string `json:"finalizers,omitempty"`
}
NamespaceSpec defines the behavior of the Namespace
type NamespaceStatus ¶
type NamespaceStatus struct {
// Phase is the current lifecycle phase of the namespace
Phase string `json:"phase,omitempty"`
// Conditions represents the latest available observations of a namespace's current state
Conditions []NamespaceCondition `json:"conditions,omitempty"`
}
NamespaceStatus describes the current status of a Namespace
type OwnerReference ¶
type OwnerReference struct {
// APIVersion of the referent
APIVersion string `json:"apiVersion" required:"true"`
// Kind of the referent
Kind string `json:"kind" required:"true"`
// Name of the referent
Name string `json:"name" required:"true"`
// UID of the referent
UID string `json:"uid" required:"true"`
// If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted
BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty"`
// If true, this reference points to the managing controller
Controller *bool `json:"controller,omitempty"`
}
OwnerReference contains the information to let you identify an owning object
type Preconditions ¶
type Preconditions struct {
// ResourceVersion specifies the target ResourceVersion
ResourceVersion string `json:"resourceVersion,omitempty"`
// UID specifies the target UID
UID string `json:"uid,omitempty"`
}
Preconditions represents conditions that must be fulfilled before deletion
type StatusCause ¶
type StatusCause struct {
// Field that caused the error
Field string `json:"field,omitempty"`
// Message describes the cause
Message string `json:"message,omitempty"`
// Reason provides machine-readable description
Reason string `json:"reason,omitempty"`
}
StatusCause represents the cause of the status
type StatusDetails ¶
type StatusDetails struct {
// Name of the resource
Name string `json:"name,omitempty"`
// Group of the resource
Group string `json:"group,omitempty"`
// Kind of the resource
Kind string `json:"kind,omitempty"`
// Causes of the status
Causes []StatusCause `json:"causes,omitempty"`
// RetryAfterSeconds specifies the time to wait before retrying
RetryAfterSeconds int `json:"retryAfterSeconds,omitempty"`
// UID of the resource
UID string `json:"uid,omitempty"`
}
StatusDetails represents additional information about the status