Class: Fog::Parsers::AWS::Compute::DescribeVolumeStatus

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/aws/parsers/compute/describe_volume_status.rb

Instance Method Summary collapse

Instance Method Details

#end_element(name) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/fog/aws/parsers/compute/describe_volume_status.rb', line 29

def end_element(name)
  if @in_actions_set
    case name
    when 'actionsSet'
      @in_actions_set = false
    when 'code', 'eventId', 'eventType', 'description'
      @action_set[name] = value.strip
    when 'item'
      @volume['actionsSet'] << @action_set
      @action_set = {}
    end
  elsif @in_details
    case name
    when 'details'
      @in_details = false
    when 'name', 'status'
      @detail[name] = value
    when 'item'
      @volume_status['details'] << @detail
      @detail = {}
    end
  elsif @in_events_set
    case name
    when 'eventsSet'
      @in_events_set = false
    when 'code', 'eventId', 'eventType', 'description'
      @event_set[name] = value.strip
    when 'notAfter', 'notBefore'
      @event_set[name] = Time.parse(value)
    when 'item'
      @volume['eventsSet'] << @event_set
      @event_set = {}
    end
  elsif @in_volume_status
    case name
    when 'volumeStatus'
      @volume['volumeStatus'] = @volume_status
      @volume_status = { 'details' => [] }
      @in_volume_status = false
    when 'status'
      @volume_status[name] = value
    end
  else
    case name
    when 'volumeId', 'availabilityZone'
      @volume[name] = value
    when 'nextToken', 'requestId'
      @response[name] = value
    when 'item'
      @response['volumeStatusSet'] << @volume
      @volume = { 'actionsSet' => [], 'eventsSet' => [] }
    end
  end
end

#resetObject



6
7
8
9
10
11
12
13
# File 'lib/fog/aws/parsers/compute/describe_volume_status.rb', line 6

def reset
  @action_set = {}
  @detail = {}
  @event_set = {}
  @volume_status = { 'details' => [] }
  @volume = { 'actionsSet' => [], 'eventsSet' => [] }
  @response = { 'volumeStatusSet' => [] }
end

#start_element(name, attrs = []) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/fog/aws/parsers/compute/describe_volume_status.rb', line 15

def start_element(name, attrs=[])
  super
  case name
  when 'actionsSet'
    @in_actions_set = true
  when 'details'
    @in_details = true
  when 'eventsSet'
    @in_events_set = true
  when 'volumeStatus'
    @in_volume_status = true
  end
end