Merge branch '21356-clean-imports'
[arvados.git] / sdk / go / arvados / node.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: Apache-2.0
4
5 package arvados
6
7 import "time"
8
9 // Node is an arvados#node resource.
10 type Node struct {
11         UUID       string         `json:"uuid"`
12         Domain     string         `json:"domain"`
13         Hostname   string         `json:"hostname"`
14         IPAddress  string         `json:"ip_address"`
15         LastPingAt *time.Time     `json:"last_ping_at"`
16         SlotNumber int            `json:"slot_number"`
17         Status     string         `json:"status"`
18         JobUUID    string         `json:"job_uuid"`
19         Properties NodeProperties `json:"properties"`
20 }
21
22 type NodeProperties struct {
23         CloudNode      NodePropertiesCloudNode `json:"cloud_node"`
24         TotalCPUCores  int                     `json:"total_cpu_cores,omitempty"`
25         TotalScratchMB int64                   `json:"total_scratch_mb,omitempty"`
26         TotalRAMMB     int64                   `json:"total_ram_mb,omitempty"`
27 }
28
29 type NodePropertiesCloudNode struct {
30         Size  string  `json:"size,omitempty"`
31         Price float64 `json:"price"`
32 }
33
34 func (c Node) resourceName() string {
35         return "node"
36 }
37
38 // NodeList is an arvados#nodeList resource.
39 type NodeList struct {
40         Items          []Node `json:"items"`
41         ItemsAvailable int    `json:"items_available"`
42         Offset         int    `json:"offset"`
43         Limit          int    `json:"limit"`
44 }