github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/cce/v1/nodes/results.go (about)

     1  package nodes
     2  
     3  import (
     4  	"github.com/opentelekomcloud/gophertelekomcloud"
     5  )
     6  
     7  type ListNodes struct {
     8  	Kind       string       `json:"kind"`
     9  	ApiVersion string       `json:"apiVersion"`
    10  	Metadata   MetadataLink `json:"metadata"`
    11  	Nodes      []Node       `json:"items"`
    12  }
    13  
    14  type MetadataLink struct {
    15  	SelfLink        string `json:"selfLink"`
    16  	ResourceVersion string `json:"resourceVersion"`
    17  }
    18  
    19  type GetNode struct {
    20  	Kind       string       `json:"kind"`
    21  	ApiVersion string       `json:"apiVersion"`
    22  	Metadata   MetadataNode `json:"metadata"`
    23  	Spec       Spec         `json:"spec"`
    24  	Status     Status       `json:"status"`
    25  }
    26  
    27  type Node struct {
    28  	Metadata MetadataNode `json:"metadata"`
    29  	Spec     Spec         `json:"spec"`
    30  	Status   Status       `json:"status"`
    31  }
    32  
    33  type MetadataNode struct {
    34  	Name              string                 `json:"name"`
    35  	SelfLink          string                 `json:"selfLink"`
    36  	ID                string                 `json:"uid"`
    37  	ResourceVersion   string                 `json:"resourceVersion"`
    38  	CreationTimestamp string                 `json:"creationTimestamp"`
    39  	Labels            map[string]interface{} `json:"labels"`
    40  	Annotations       map[string]interface{} `json:"annotations"`
    41  }
    42  
    43  type Spec struct {
    44  	ProviderID string  `json:"providerID"`
    45  	Taints     []Taint `json:"taints"`
    46  }
    47  
    48  type Taint struct {
    49  	Key    string `json:"key"`
    50  	Value  string `json:"value"`
    51  	Effect string `json:"effect"`
    52  }
    53  
    54  type Status struct {
    55  	Capacity        Capacity       `json:"capacity"`
    56  	Allocatable     Capacity       `json:"allocatable"`
    57  	Conditions      []Condition    `json:"conditions"`
    58  	Addresses       []Address      `json:"addresses"`
    59  	DaemonEndpoints DaemonEndpoint `json:"daemonEndpoints"`
    60  	NodeInfo        NodeInfo       `json:"nodeInfo"`
    61  	Images          []Image        `json:"images"`
    62  }
    63  
    64  type Capacity struct {
    65  	CCEEni           string `json:"cce/eni"`
    66  	CCESubEni        string `json:"cce/sub-eni"`
    67  	CPU              string `json:"cpu"`
    68  	EphemeralStorage string `json:"ephemeral-storage"`
    69  	HugePages1Gi     string `json:"hugepages-1Gi"`
    70  	HugePages2Mi     string `json:"hugepages-2Mi"`
    71  	Memory           string `json:"memory"`
    72  	Pods             string `json:"pods"`
    73  }
    74  
    75  type Condition struct {
    76  	Type               string `json:"type"`
    77  	Status             string `json:"status"`
    78  	LastHeartbeatTime  string `json:"lastHeartbeatTime"`
    79  	LastTransitionTime string `json:"lastTransitionTime"`
    80  	Reason             string `json:"reason"`
    81  	Message            string `json:"message"`
    82  }
    83  
    84  type Address struct {
    85  	Type    string `json:"type"`
    86  	Address string `json:"address"`
    87  }
    88  
    89  type DaemonEndpoint struct {
    90  	KubeletEndpoint PortEndpoint `json:"kubeletEndpoint"`
    91  }
    92  
    93  type PortEndpoint struct {
    94  	Port int `json:"Port"`
    95  }
    96  
    97  type NodeInfo struct {
    98  	MachineID               string `json:"machineID"`
    99  	SystemUUID              string `json:"systemUUID"`
   100  	BootID                  string `json:"bootID"`
   101  	KernelVersion           string `json:"kernelVersion"`
   102  	OsImage                 string `json:"osImage"`
   103  	ContainerRuntimeVersion string `json:"containerRuntimeVersion"`
   104  	KubeletVersion          string `json:"kubeletVersion"`
   105  	KubeProxyVersion        string `json:"kubeProxyVersion"`
   106  	OperatingSystem         string `json:"operatingSystem"`
   107  	Architecture            string `json:"architecture"`
   108  	EniQuotaSize            string `json:"eniQuotaSize"`
   109  }
   110  
   111  type Image struct {
   112  	Names     []string `json:"names"`
   113  	SizeBytes int      `json:"sizeBytes"`
   114  }
   115  
   116  type ListResult struct {
   117  	golangsdk.Result
   118  }
   119  
   120  func (r ListResult) Extract() (*ListNodes, error) {
   121  	s := new(ListNodes)
   122  	err := r.ExtractIntoStructPtr(s, "")
   123  	return s, err
   124  }
   125  
   126  type GetResult struct {
   127  	golangsdk.Result
   128  }
   129  
   130  func (r GetResult) Extract() (*GetNode, error) {
   131  	s := new(GetNode)
   132  	err := r.ExtractIntoStructPtr(s, "")
   133  	return s, err
   134  }
   135  
   136  type UpdateResult struct {
   137  	golangsdk.Result
   138  }
   139  
   140  func (r UpdateResult) Extract() (*GetNode, error) {
   141  	s := new(GetNode)
   142  	err := r.ExtractIntoStructPtr(s, "")
   143  	return s, err
   144  }