Documentation ¶
Index ¶
- func List(client *golangsdk.ServiceClient, clusterID string, opts ListOptsBuilder) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type Initializers
- type ListOpts
- type ListOptsBuilder
- type MetaResp
- type Metadata
- type Namespace
- type NamespacePage
- type OwnerReference
- type Pending
- type Spec
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *golangsdk.ServiceClient, clusterID string, opts ListOptsBuilder) pagination.Pager
List is a method to obtain the specified namespaces according to the ListOpts.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Kind is a string value representing the REST resource this object represents. // Servers may infer this from the endpoint the client submits requests to. Cannot be updated. // The value of this parameter is Namespace. Kind string `json:"kind" required:"true"` // ApiVersion defines the versioned schema of this representation of an object. // Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. // The value of this parameter is v1. ApiVersion string `json:"apiVersion" required:"true"` // Standard object metadata. Metadata Metadata `json:"metadata" required:"true"` // Spec defines the behavior of the Namespace. Spec *Spec `json:"spec,omitempty"` // Status describes the current status of a Namespace. Status *Status `json:"status,omitempty"` }
CreateOpts allows to create a namespace using given parameters.
func (CreateOpts) ToNamespaceCreateMap ¶
func (opts CreateOpts) ToNamespaceCreateMap() (map[string]interface{}, error)
ToNamespaceCreateMap builds a create request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents a result of the Create method.
func Create ¶
func Create(client *golangsdk.ServiceClient, clusterID string, opts CreateOptsBuilder) (r CreateResult)
Create accepts a CreateOpts struct and uses the values to create a new namespace.
type DeleteResult ¶
type DeleteResult struct {
// contains filtered or unexported fields
}
DeleteResult represents a result of the Delete method.
func Delete ¶
func Delete(client *golangsdk.ServiceClient, clusterID, name string) (r DeleteResult)
Delete is a method to delete an existing namespace.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents a result of the Get method.
type Initializers ¶
type Initializers struct { // List of initializers that must execute in order before this object is visible. Pendings []Pending `json:"pending,omitempty"` }
Initializers is a controller which enforces some system invariant at namespace creation time.
type ListOpts ¶
type ListOpts struct { Pretty string `q:"pretty"` Continue string `q:"continue"` LabelSelector string `q:"labelSelector"` FieldSelector string `q:"fieldSelector"` Limit string `q:"limit"` IncludeUninitialized string `q:"includeUninitialized"` Watch string `q:"watch"` ResourceVersion string `q:"resourceVersion"` Timeout string `q:"timeoutSeconds"` }
ListOpts allows to filter list data using given parameters.
func (ListOpts) ToNamespaceListQuery ¶
ToNamespaceListQuery is a method which to build a request query by the ListOpts.
type ListOptsBuilder ¶
ListOptsBuilder is an interface which to support request query build of the namespace search.
type MetaResp ¶
type MetaResp struct { // Namespace name. Name string `json:"name"` // A prefix used by the server to generate a unique name ONLY IF the Name field has not been provided. GenerateName string `json:"generateName,omitempty"` // URL representing this object. SelfLink string `json:"selfLink"` UID string `json:"uid"` // 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"` // 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]interface{} `json:"annotations"` // Enabled identify whether the resource is available. Enable bool `json:"enable"` // Map of string keys and values that can be used to organize and categorize (scope and select) objects. Labels map[string]interface{} `json:"labels"` // An optional prefix used by the server to generate a unique name ONLY IF the Name field has not been provided. Genetation string `json:"generation"` CreationTimestamp string `json:"creationTimestamp"` DeletionTimestamp string `json:"DeletionTimestamp"` }
MetaResp is a standard object metadata.
type Metadata ¶
type Metadata struct { // Namespace name. 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. Cannot be updated. // The name is consists of 1 to 63 characters and must be a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?. Name string `json:"name,omitempty"` // An initializer is a controller which enforces some system invariant at object creation time. Initializers *Initializers `json:"initializers,omitempty"` // Enabled identify whether the resource is available. Enabled bool `json:"enable,omitempty"` // An optional prefix used by the server to generate a unique name ONLY IF the Name field has not been provided. // The name is consists of 1 to 253 characters and must bee a regular expression [a-z0-9]([-a-z0-9]*[a-z0-9])?. GenerateName string `json:"generateName,omitempty"` // Map of string keys and values that can be used to organize and categorize (scope and select) objects. // May match selectors of replication controllers and services. Labels map[string]interface{} `json:"labels,omitempty"` // An unstructured key value map stored with a resource that may be set by external tools to store and retrieve // arbitrary metadata. They are not queryable and should be preserved when modifying objects. Annotations map[string]interface{} `json:"annotations,omitempty"` // List of objects depended by this object. OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"` // Finalizers is an opaque list of values that must be empty to permanently remove object from storage. Finalizers []string `json:"finalizers,omitempty"` }
Metadata is an object which will be build up standard object metadata.
type Namespace ¶
type Namespace struct { // Standard object metadata. Metadata MetaResp `json:"metadata"` // Spec defines the behavior of the Namespace. Spec Spec `json:"spec"` // Status describes the current status of a Namespace. Status Status `json:"status"` }
Namespace is a struct that represents the result of Create and Get methods.
func ExtractNamespaces ¶
func ExtractNamespaces(r pagination.Page) ([]Namespace, error)
ExtractNamespaces is a method which to interpret the namespace pages as a namespace object list.
type NamespacePage ¶
type NamespacePage struct {
pagination.SinglePageBase
}
NamespacePage represents a result of the List method.
type OwnerReference ¶
type OwnerReference struct { // API version 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"` // If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the // key-value store until this reference is removed. Defaults to false. BlockOwnerDeletion bool `json:"blockOwnerDeletion,omitempty"` }
OwnerReference is a list of objects depended by this object.
type Pending ¶
type Pending struct { // Name of the process that is responsible for initializing this object. Name string `json:"name,omitempty"` }
Pending is an object of initializers that must execute in order before this object is visible.