mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|iam] Add parser for server certificates
This commit is contained in:
parent
9176deba4a
commit
8a59ceed2d
2 changed files with 28 additions and 2 deletions
26
lib/fog/aws/parsers/iam/upload_server_certificate.rb
Normal file
26
lib/fog/aws/parsers/iam/upload_server_certificate.rb
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
module Fog
|
||||||
|
module Parsers
|
||||||
|
module AWS
|
||||||
|
module IAM
|
||||||
|
|
||||||
|
class UploadServerCertificate < Fog::Parsers::Base
|
||||||
|
|
||||||
|
def reset
|
||||||
|
@response = { 'Certificate' => {} }
|
||||||
|
end
|
||||||
|
|
||||||
|
def end_element(name)
|
||||||
|
case name
|
||||||
|
when 'Arn', 'Path', 'ServerCertificateId', 'ServerCertificateName', 'UploadDate'
|
||||||
|
@response['Certificate'][name] = @value
|
||||||
|
when 'RequestId'
|
||||||
|
@response[name] = @value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -3,7 +3,7 @@ module Fog
|
||||||
class IAM
|
class IAM
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
require 'fog/aws/parsers/iam/basic'
|
require 'fog/aws/parsers/iam/upload_server_certificate'
|
||||||
|
|
||||||
# Uploads a server certificate entity for the AWS Account.
|
# Uploads a server certificate entity for the AWS Account.
|
||||||
# Includes a public key certificate, a private key, and an optional certificate chain, which should all be PEM-encoded.
|
# Includes a public key certificate, a private key, and an optional certificate chain, which should all be PEM-encoded.
|
||||||
|
@ -35,7 +35,7 @@ module Fog
|
||||||
'CertificateBody' => certificate,
|
'CertificateBody' => certificate,
|
||||||
'PrivateKey' => private_key,
|
'PrivateKey' => private_key,
|
||||||
'ServerCertificateName' => name,
|
'ServerCertificateName' => name,
|
||||||
:parser => Fog::Parsers::AWS::IAM::Basic.new
|
:parser => Fog::Parsers::AWS::IAM::UploadServerCertificate.new
|
||||||
}.merge!(options))
|
}.merge!(options))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue