Class: Files::FrontEndServer

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/front_end_server.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ FrontEndServer

Returns a new instance of FrontEndServer.



7
8
9
10
# File 'lib/files.com/models/front_end_server.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/front_end_server.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/front_end_server.rb', line 5

def options
  @options
end

Class Method Details

.create(params = {}, options = {}) ⇒ Object

Parameters:

name (required) - string - Server's short name.
hostname - string - Server's full hostname.
zone - string - Availability zone where this server lives.
ips - array(string) - An array of public and private ip address pairs.
ips[private_ip] (required) - array(string) - Private IP address associated with the server.
ips[public_ip] - array(string) - Public IP address associated with the server.
primary_ip - string - Primary Internal IP.
primary_ip_public - string - Primary Public IP.
soo_ip - string - Security Opt Out Internal IP.
soo_ip_public - string - Security Opt Out Public IP.
exavault_ip - string - Exavault Internal IP.
exavault_ip_public - string - Exavault Public IP.
exavault_soo_ip - string - Exavault Security Opt Out Internal IP.
exavault_soo_ip_public - string - Exavault Security Opt Out Public IP.
smartfile_ip - string - Smartfile Internal IP.
smartfile_ip_public - string - Smartfile Public IP.
smartfile_soo_ip - string - Smartfile Security Opt Out Internal IP.
smartfile_soo_ip_public - string - Smartfile Security Opt Out Public IP.


312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/files.com/models/front_end_server.rb', line 312

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: hostname must be an String") if params[:hostname] and !params[:hostname].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: zone must be an String") if params[:zone] and !params[:zone].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: ips must be an Array") if params[:ips] and !params[:ips].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: primary_ip must be an String") if params[:primary_ip] and !params[:primary_ip].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: primary_ip_public must be an String") if params[:primary_ip_public] and !params[:primary_ip_public].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: soo_ip must be an String") if params[:soo_ip] and !params[:soo_ip].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: soo_ip_public must be an String") if params[:soo_ip_public] and !params[:soo_ip_public].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: exavault_ip must be an String") if params[:exavault_ip] and !params[:exavault_ip].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: exavault_ip_public must be an String") if params[:exavault_ip_public] and !params[:exavault_ip_public].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: exavault_soo_ip must be an String") if params[:exavault_soo_ip] and !params[:exavault_soo_ip].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: exavault_soo_ip_public must be an String") if params[:exavault_soo_ip_public] and !params[:exavault_soo_ip_public].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: smartfile_ip must be an String") if params[:smartfile_ip] and !params[:smartfile_ip].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: smartfile_ip_public must be an String") if params[:smartfile_ip_public] and !params[:smartfile_ip_public].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: smartfile_soo_ip must be an String") if params[:smartfile_soo_ip] and !params[:smartfile_soo_ip].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: smartfile_soo_ip_public must be an String") if params[:smartfile_soo_ip_public] and !params[:smartfile_soo_ip_public].is_a?(String)
  raise MissingParameterError.new("Parameter missing: name") unless params[:name]

  response, options = Api.send_request("/front_end_servers", :post, params, options)
  Ip.new(response.data, options)
end

Instance Method Details

#assignedObject

boolean - Flag to signal to other systems to use this config



31
32
33
# File 'lib/files.com/models/front_end_server.rb', line 31

def assigned
  @attributes[:assigned]
end

#assigned=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/front_end_server.rb', line 35

def assigned=(value)
  @attributes[:assigned] = value
end

#custom_domainsObject

array(object) - Active Custom Domains for the site associated with this IP, with their attached SSL certificate content.



121
122
123
# File 'lib/files.com/models/front_end_server.rb', line 121

def custom_domains
  @attributes[:custom_domains]
end

#custom_domains=(value) ⇒ Object



125
126
127
# File 'lib/files.com/models/front_end_server.rb', line 125

def custom_domains=(value)
  @attributes[:custom_domains] = value
end

#exavault_ipObject

string - Exavault Internal IP.



211
212
213
# File 'lib/files.com/models/front_end_server.rb', line 211

def exavault_ip
  @attributes[:exavault_ip]
end

#exavault_ip=(value) ⇒ Object



215
216
217
# File 'lib/files.com/models/front_end_server.rb', line 215

def exavault_ip=(value)
  @attributes[:exavault_ip] = value
end

#exavault_ip_publicObject

string - Exavault Public IP.



220
221
222
# File 'lib/files.com/models/front_end_server.rb', line 220

def exavault_ip_public
  @attributes[:exavault_ip_public]
end

#exavault_ip_public=(value) ⇒ Object



224
225
226
# File 'lib/files.com/models/front_end_server.rb', line 224

def exavault_ip_public=(value)
  @attributes[:exavault_ip_public] = value
end

#exavault_soo_ipObject

string - Exavault Security Opt Out Internal IP.



229
230
231
# File 'lib/files.com/models/front_end_server.rb', line 229

def exavault_soo_ip
  @attributes[:exavault_soo_ip]
end

#exavault_soo_ip=(value) ⇒ Object



233
234
235
# File 'lib/files.com/models/front_end_server.rb', line 233

def exavault_soo_ip=(value)
  @attributes[:exavault_soo_ip] = value
end

#exavault_soo_ip_publicObject

string - Exavault Security Opt Out Public IP.



238
239
240
# File 'lib/files.com/models/front_end_server.rb', line 238

def exavault_soo_ip_public
  @attributes[:exavault_soo_ip_public]
end

#exavault_soo_ip_public=(value) ⇒ Object



242
243
244
# File 'lib/files.com/models/front_end_server.rb', line 242

def exavault_soo_ip_public=(value)
  @attributes[:exavault_soo_ip_public] = value
end

#external_ipObject

string - Public IP of the server.



22
23
24
# File 'lib/files.com/models/front_end_server.rb', line 22

def external_ip
  @attributes[:external_ip]
end

#external_ip=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/front_end_server.rb', line 26

def external_ip=(value)
  @attributes[:external_ip] = value
end

#ftp_enabledObject

boolean



49
50
51
# File 'lib/files.com/models/front_end_server.rb', line 49

def ftp_enabled
  @attributes[:ftp_enabled]
end

#ftp_enabled=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/front_end_server.rb', line 53

def ftp_enabled=(value)
  @attributes[:ftp_enabled] = value
end

#hostnameObject

string - Server's full hostname.



148
149
150
# File 'lib/files.com/models/front_end_server.rb', line 148

def hostname
  @attributes[:hostname]
end

#hostname=(value) ⇒ Object



152
153
154
# File 'lib/files.com/models/front_end_server.rb', line 152

def hostname=(value)
  @attributes[:hostname] = value
end

#ipObject

string - Private IP of the server.



13
14
15
# File 'lib/files.com/models/front_end_server.rb', line 13

def ip
  @attributes[:ip]
end

#ip=(value) ⇒ Object



17
18
19
# File 'lib/files.com/models/front_end_server.rb', line 17

def ip=(value)
  @attributes[:ip] = value
end

#ipsObject

array(string) - An array of public and private ip address pairs.



166
167
168
# File 'lib/files.com/models/front_end_server.rb', line 166

def ips
  @attributes[:ips]
end

#ips=(value) ⇒ Object



170
171
172
# File 'lib/files.com/models/front_end_server.rb', line 170

def ips=(value)
  @attributes[:ips] = value
end

#motd_textObject

string - A message to show users when they connect via FTP or SFTP.



94
95
96
# File 'lib/files.com/models/front_end_server.rb', line 94

def motd_text
  @attributes[:motd_text]
end

#motd_text=(value) ⇒ Object



98
99
100
# File 'lib/files.com/models/front_end_server.rb', line 98

def motd_text=(value)
  @attributes[:motd_text] = value
end

#motd_use_for_ftpObject

boolean - Show message to users connecting via FTP



103
104
105
# File 'lib/files.com/models/front_end_server.rb', line 103

def motd_use_for_ftp
  @attributes[:motd_use_for_ftp]
end

#motd_use_for_ftp=(value) ⇒ Object



107
108
109
# File 'lib/files.com/models/front_end_server.rb', line 107

def motd_use_for_ftp=(value)
  @attributes[:motd_use_for_ftp] = value
end

#motd_use_for_sftpObject

boolean - Show message to users connecting via SFTP



112
113
114
# File 'lib/files.com/models/front_end_server.rb', line 112

def motd_use_for_sftp
  @attributes[:motd_use_for_sftp]
end

#motd_use_for_sftp=(value) ⇒ Object



116
117
118
# File 'lib/files.com/models/front_end_server.rb', line 116

def motd_use_for_sftp=(value)
  @attributes[:motd_use_for_sftp] = value
end

#nameObject

string - Server's short name.



139
140
141
# File 'lib/files.com/models/front_end_server.rb', line 139

def name
  @attributes[:name]
end

#name=(value) ⇒ Object



143
144
145
# File 'lib/files.com/models/front_end_server.rb', line 143

def name=(value)
  @attributes[:name] = value
end

#pair_typeObject

string - Pair type for General Use Public IPs



130
131
132
# File 'lib/files.com/models/front_end_server.rb', line 130

def pair_type
  @attributes[:pair_type]
end

#pair_type=(value) ⇒ Object



134
135
136
# File 'lib/files.com/models/front_end_server.rb', line 134

def pair_type=(value)
  @attributes[:pair_type] = value
end

#primary_ipObject

string - Primary Internal IP.



175
176
177
# File 'lib/files.com/models/front_end_server.rb', line 175

def primary_ip
  @attributes[:primary_ip]
end

#primary_ip=(value) ⇒ Object



179
180
181
# File 'lib/files.com/models/front_end_server.rb', line 179

def primary_ip=(value)
  @attributes[:primary_ip] = value
end

#primary_ip_publicObject

string - Primary Public IP.



184
185
186
# File 'lib/files.com/models/front_end_server.rb', line 184

def primary_ip_public
  @attributes[:primary_ip_public]
end

#primary_ip_public=(value) ⇒ Object



188
189
190
# File 'lib/files.com/models/front_end_server.rb', line 188

def primary_ip_public=(value)
  @attributes[:primary_ip_public] = value
end

#saveObject



282
283
284
285
286
287
288
289
290
291
# File 'lib/files.com/models/front_end_server.rb', line 282

def save
  if @attributes[:id]
    raise NotImplementedError.new("The FrontEndServer object doesn't support updates.")
  else
    new_obj = FrontEndServer.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end

#sftp_enabledObject

boolean



58
59
60
# File 'lib/files.com/models/front_end_server.rb', line 58

def sftp_enabled
  @attributes[:sftp_enabled]
end

#sftp_enabled=(value) ⇒ Object



62
63
64
# File 'lib/files.com/models/front_end_server.rb', line 62

def sftp_enabled=(value)
  @attributes[:sftp_enabled] = value
end

#sftp_host_key_private_keyObject

string - SFTP Host Key private key if using a custom key.



76
77
78
# File 'lib/files.com/models/front_end_server.rb', line 76

def sftp_host_key_private_key
  @attributes[:sftp_host_key_private_key]
end

#sftp_host_key_private_key=(value) ⇒ Object



80
81
82
# File 'lib/files.com/models/front_end_server.rb', line 80

def sftp_host_key_private_key=(value)
  @attributes[:sftp_host_key_private_key] = value
end

#sftp_host_key_typeObject

string - Which SFTP host key to use.



67
68
69
# File 'lib/files.com/models/front_end_server.rb', line 67

def sftp_host_key_type
  @attributes[:sftp_host_key_type]
end

#sftp_host_key_type=(value) ⇒ Object



71
72
73
# File 'lib/files.com/models/front_end_server.rb', line 71

def sftp_host_key_type=(value)
  @attributes[:sftp_host_key_type] = value
end

#siteObject

SslCertificate - SSL certificate information for the site associated with this IP, if available.



40
41
42
# File 'lib/files.com/models/front_end_server.rb', line 40

def site
  @attributes[:site]
end

#site=(value) ⇒ Object



44
45
46
# File 'lib/files.com/models/front_end_server.rb', line 44

def site=(value)
  @attributes[:site] = value
end

#site_idObject

int64 - Site Id



85
86
87
# File 'lib/files.com/models/front_end_server.rb', line 85

def site_id
  @attributes[:site_id]
end

#site_id=(value) ⇒ Object



89
90
91
# File 'lib/files.com/models/front_end_server.rb', line 89

def site_id=(value)
  @attributes[:site_id] = value
end

#smartfile_ipObject

string - Smartfile Internal IP.



247
248
249
# File 'lib/files.com/models/front_end_server.rb', line 247

def smartfile_ip
  @attributes[:smartfile_ip]
end

#smartfile_ip=(value) ⇒ Object



251
252
253
# File 'lib/files.com/models/front_end_server.rb', line 251

def smartfile_ip=(value)
  @attributes[:smartfile_ip] = value
end

#smartfile_ip_publicObject

string - Smartfile Public IP.



256
257
258
# File 'lib/files.com/models/front_end_server.rb', line 256

def smartfile_ip_public
  @attributes[:smartfile_ip_public]
end

#smartfile_ip_public=(value) ⇒ Object



260
261
262
# File 'lib/files.com/models/front_end_server.rb', line 260

def smartfile_ip_public=(value)
  @attributes[:smartfile_ip_public] = value
end

#smartfile_soo_ipObject

string - Smartfile Security Opt Out Internal IP.



265
266
267
# File 'lib/files.com/models/front_end_server.rb', line 265

def smartfile_soo_ip
  @attributes[:smartfile_soo_ip]
end

#smartfile_soo_ip=(value) ⇒ Object



269
270
271
# File 'lib/files.com/models/front_end_server.rb', line 269

def smartfile_soo_ip=(value)
  @attributes[:smartfile_soo_ip] = value
end

#smartfile_soo_ip_publicObject

string - Smartfile Security Opt Out Public IP.



274
275
276
# File 'lib/files.com/models/front_end_server.rb', line 274

def smartfile_soo_ip_public
  @attributes[:smartfile_soo_ip_public]
end

#smartfile_soo_ip_public=(value) ⇒ Object



278
279
280
# File 'lib/files.com/models/front_end_server.rb', line 278

def smartfile_soo_ip_public=(value)
  @attributes[:smartfile_soo_ip_public] = value
end

#soo_ipObject

string - Security Opt Out Internal IP.



193
194
195
# File 'lib/files.com/models/front_end_server.rb', line 193

def soo_ip
  @attributes[:soo_ip]
end

#soo_ip=(value) ⇒ Object



197
198
199
# File 'lib/files.com/models/front_end_server.rb', line 197

def soo_ip=(value)
  @attributes[:soo_ip] = value
end

#soo_ip_publicObject

string - Security Opt Out Public IP.



202
203
204
# File 'lib/files.com/models/front_end_server.rb', line 202

def soo_ip_public
  @attributes[:soo_ip_public]
end

#soo_ip_public=(value) ⇒ Object



206
207
208
# File 'lib/files.com/models/front_end_server.rb', line 206

def soo_ip_public=(value)
  @attributes[:soo_ip_public] = value
end

#zoneObject

string - Availability zone where this server lives.



157
158
159
# File 'lib/files.com/models/front_end_server.rb', line 157

def zone
  @attributes[:zone]
end

#zone=(value) ⇒ Object



161
162
163
# File 'lib/files.com/models/front_end_server.rb', line 161

def zone=(value)
  @attributes[:zone] = value
end