cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
cluster.py
Go to the documentation of this file.
1 # coding: utf-8
2 
3 """
4  cloudFPGA Resource Manager API
5 
6  No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 
8  OpenAPI spec version: 0.8
9 
10  Generated by: https://github.com/swagger-api/swagger-codegen.git
11 """
12 
13 import pprint
14 import re # noqa: F401
15 
16 import six
17 
18 class Cluster(object):
19  """NOTE: This class is auto generated by the swagger code generator program.
20 
21  Do not edit the class manually.
22  """
23  """
24  Attributes:
25  swagger_types (dict): The key is attribute name
26  and the value is attribute type.
27  attribute_map (dict): The key is attribute name
28  and the value is json key in definition.
29  """
30  swagger_types = {
31  'cluster_id': 'int',
32  'instances': 'list[Instance]',
33  'nodes': 'NodeMap',
34  'user_id': 'str'
35  }
36 
37  attribute_map = {
38  'cluster_id': 'cluster_id',
39  'instances': 'instances',
40  'nodes': 'nodes',
41  'user_id': 'user_id'
42  }
43 
44  def __init__(self, cluster_id=None, instances=None, nodes=None, user_id=None): # noqa: E501
45  """Cluster - a model defined in Swagger""" # noqa: E501
46  self._cluster_id_cluster_id = None
47  self._instances_instances = None
48  self._nodes_nodes = None
49  self._user_id_user_id = None
50  self.discriminatordiscriminator = None
51  if cluster_id is not None:
52  self.cluster_idcluster_idcluster_idcluster_id = cluster_id
53  if instances is not None:
54  self.instancesinstancesinstancesinstances = instances
55  if nodes is not None:
56  self.nodesnodesnodesnodes = nodes
57  if user_id is not None:
58  self.user_iduser_iduser_iduser_id = user_id
59 
60  @property
61  def cluster_id(self):
62  """Gets the cluster_id of this Cluster. # noqa: E501
63 
64  ID of cluster # noqa: E501
65 
66  :return: The cluster_id of this Cluster. # noqa: E501
67  :rtype: int
68  """
69  return self._cluster_id_cluster_id
70 
71  @cluster_id.setter
72  def cluster_id(self, cluster_id):
73  """Sets the cluster_id of this Cluster.
74 
75  ID of cluster # noqa: E501
76 
77  :param cluster_id: The cluster_id of this Cluster. # noqa: E501
78  :type: int
79  """
80 
81  self._cluster_id_cluster_id = cluster_id
82 
83  @property
84  def instances(self):
85  """Gets the instances of this Cluster. # noqa: E501
86 
87 
88  :return: The instances of this Cluster. # noqa: E501
89  :rtype: list[Instance]
90  """
91  return self._instances_instances
92 
93  @instances.setter
94  def instances(self, instances):
95  """Sets the instances of this Cluster.
96 
97 
98  :param instances: The instances of this Cluster. # noqa: E501
99  :type: list[Instance]
100  """
101 
102  self._instances_instances = instances
103 
104  @property
105  def nodes(self):
106  """Gets the nodes of this Cluster. # noqa: E501
107 
108 
109  :return: The nodes of this Cluster. # noqa: E501
110  :rtype: NodeMap
111  """
112  return self._nodes_nodes
113 
114  @nodes.setter
115  def nodes(self, nodes):
116  """Sets the nodes of this Cluster.
117 
118 
119  :param nodes: The nodes of this Cluster. # noqa: E501
120  :type: NodeMap
121  """
122 
123  self._nodes_nodes = nodes
124 
125  @property
126  def user_id(self):
127  """Gets the user_id of this Cluster. # noqa: E501
128 
129  User ID # noqa: E501
130 
131  :return: The user_id of this Cluster. # noqa: E501
132  :rtype: str
133  """
134  return self._user_id_user_id
135 
136  @user_id.setter
137  def user_id(self, user_id):
138  """Sets the user_id of this Cluster.
139 
140  User ID # noqa: E501
141 
142  :param user_id: The user_id of this Cluster. # noqa: E501
143  :type: str
144  """
145 
146  self._user_id_user_id = user_id
147 
148  def to_dict(self):
149  """Returns the model properties as a dict"""
150  result = {}
151 
152  for attr, _ in six.iteritems(self.swagger_typesswagger_types):
153  value = getattr(self, attr)
154  if isinstance(value, list):
155  result[attr] = list(map(
156  lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
157  value
158  ))
159  elif hasattr(value, "to_dict"):
160  result[attr] = value.to_dict()
161  elif isinstance(value, dict):
162  result[attr] = dict(map(
163  lambda item: (item[0], item[1].to_dict())
164  if hasattr(item[1], "to_dict") else item,
165  value.items()
166  ))
167  else:
168  result[attr] = value
169  if issubclass(Cluster, dict):
170  for key, value in self.items():
171  result[key] = value
172 
173  return result
174 
175  def to_str(self):
176  """Returns the string representation of the model"""
177  return pprint.pformat(self.to_dictto_dict())
178 
179  def __repr__(self):
180  """For `print` and `pprint`"""
181  return self.to_strto_str()
182 
183  def __eq__(self, other):
184  """Returns true if both objects are equal"""
185  if not isinstance(other, Cluster):
186  return False
187 
188  return self.__dict____dict__ == other.__dict__
189 
190  def __ne__(self, other):
191  """Returns true if both objects are not equal"""
192  return not self == other
def __init__(self, cluster_id=None, instances=None, nodes=None, user_id=None)
Definition: cluster.py:44