Class: Azure::ARM::Compute::Models::SshPublicKey

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_compute/Models/ssh_public_key.rb

Overview

Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#key_dataString

authenticate with VM through SSH.The certificate must be in Pem format with or without headers.

Returns:

  • (String)

    Gets or sets Certificate public key used to



24
25
26
# File 'lib/azure_mgmt_compute/Models/ssh_public_key.rb', line 24

def key_data
  @key_data
end

#pathString

SSH public key is stored. If the file already exists, the specified key is appended to the file.

Returns:

  • (String)

    Gets or sets the full path on the created VM where



19
20
21
# File 'lib/azure_mgmt_compute/Models/ssh_public_key.rb', line 19

def path
  @path
end

Class Method Details

.deserialize_object(object) ⇒ SshPublicKey

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/azure_mgmt_compute/Models/ssh_public_key.rb', line 56

def self.deserialize_object(object)
  return if object.nil?
  output_object = SshPublicKey.new

  deserialized_property = object['path']
  output_object.path = deserialized_property

  deserialized_property = object['keyData']
  output_object.key_data = deserialized_property

  output_object.validate

  output_object
end

.serialize_object(object) ⇒ Hash

Serializes given Model object into Ruby Hash.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of Ruby Hash.



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/azure_mgmt_compute/Models/ssh_public_key.rb', line 38

def self.serialize_object(object)
  object.validate
  output_object = {}

  serialized_property = object.path
  output_object['path'] = serialized_property unless serialized_property.nil?

  serialized_property = object.key_data
  output_object['keyData'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



29
30
31
# File 'lib/azure_mgmt_compute/Models/ssh_public_key.rb', line 29

def validate
  # Nothing to validate
end