Class: Fog::Parsers::Base

Inherits:
Nokogiri::XML::SAX::Document
  • Object
show all
Defined in:
lib/fog/core/parser.rb

Direct Known Subclasses

AWS::AutoScaling::Basic, AWS::AutoScaling::DescribeAdjustmentTypes, AWS::AutoScaling::DescribeAutoScalingGroups, AWS::AutoScaling::DescribeAutoScalingInstances, AWS::AutoScaling::DescribeAutoScalingNotificationTypes, AWS::AutoScaling::DescribeLaunchConfigurations, AWS::AutoScaling::DescribeMetricCollectionTypes, AWS::AutoScaling::DescribeNotificationConfigurations, AWS::AutoScaling::DescribePolicies, AWS::AutoScaling::DescribeScalingActivities, AWS::AutoScaling::DescribeScalingProcessTypes, AWS::AutoScaling::DescribeScheduledActions, AWS::AutoScaling::DescribeTags, AWS::AutoScaling::DescribeTerminationPolicyTypes, AWS::AutoScaling::PutNotificationConfiguration, AWS::AutoScaling::PutScalingPolicy, AWS::AutoScaling::TerminateInstanceInAutoScalingGroup, AWS::CloudFormation::Basic, AWS::CloudFormation::CreateStack, AWS::CloudFormation::DescribeStackEvents, AWS::CloudFormation::DescribeStackResources, AWS::CloudFormation::DescribeStacks, AWS::CloudFormation::GetTemplate, AWS::CloudFormation::ListStackResources, AWS::CloudFormation::ListStacks, AWS::CloudFormation::UpdateStack, AWS::CloudFormation::ValidateTemplate, AWS::CloudWatch::DeleteAlarms, AWS::CloudWatch::DescribeAlarmHistory, AWS::CloudWatch::DescribeAlarms, AWS::CloudWatch::DescribeAlarmsForMetric, AWS::CloudWatch::DisableAlarmActions, AWS::CloudWatch::EnableAlarmActions, AWS::CloudWatch::GetMetricStatistics, AWS::CloudWatch::ListMetrics, AWS::CloudWatch::PutMetricAlarm, AWS::CloudWatch::PutMetricData, AWS::CloudWatch::SetAlarmState, AWS::ELB::ApplySecurityGroupsToLoadBalancer, AWS::ELB::AttachLoadBalancerToSubnets, AWS::ELB::ConfigureHealthCheck, AWS::ELB::CreateLoadBalancer, AWS::ELB::DeleteLoadBalancer, AWS::ELB::DeregisterInstancesFromLoadBalancer, AWS::ELB::DescribeInstanceHealth, AWS::ELB::DescribeLoadBalancerAttributes, AWS::ELB::DescribeLoadBalancerPolicies, AWS::ELB::DescribeLoadBalancerPolicyTypes, AWS::ELB::DescribeLoadBalancers, AWS::ELB::DetachLoadBalancerFromSubnets, AWS::ELB::DisableAvailabilityZonesForLoadBalancer, AWS::ELB::Empty, AWS::ELB::EnableAvailabilityZonesForLoadBalancer, AWS::ELB::RegisterInstancesWithLoadBalancer, AWS::EMR::AddInstanceGroups, AWS::EMR::AddJobFlowSteps, AWS::EMR::DescribeJobFlows, AWS::EMR::ModifyInstanceGroups, AWS::EMR::RunJobFlow, AWS::EMR::SetTerminationProtection, AWS::EMR::TerminateJobFlows, AWS::ElasticBeanstalk::BaseParser, AWS::ElasticBeanstalk::Empty, AWS::Elasticache::Base, AWS::Elasticache::DescribeReservedCacheNodes, AWS::Elasticache::SecurityGroupParser, AWS::Elasticache::SubnetGroupParser, AWS::IAM::BaseInstanceProfile, AWS::IAM::Basic, AWS::IAM::CreateAccessKey, AWS::IAM::CreateGroup, AWS::IAM::CreateUser, AWS::IAM::GetAccountSummary, AWS::IAM::GetGroup, AWS::IAM::GetGroupPolicy, AWS::IAM::GetRolePolicy, AWS::IAM::GetUser, AWS::IAM::GetUserPolicy, AWS::IAM::ListAccessKeys, AWS::IAM::ListAccountAliases, AWS::IAM::ListGroups, AWS::IAM::ListGroupsForUser, AWS::IAM::ListPolicies, AWS::IAM::ListServerCertificates, AWS::IAM::ListSigningCertificates, AWS::IAM::ListUsers, AWS::IAM::LoginProfile, AWS::IAM::RoleParser, AWS::IAM::UpdateGroup, AWS::IAM::UpdateUser, AWS::IAM::UploadServerCertificate, AWS::IAM::UploadSigningCertificate, AWS::RDS::Base, AWS::RDS::CreateDbParameterGroup, AWS::RDS::DBEngineVersionParser, AWS::RDS::DbParser, AWS::RDS::DeleteDbParameterGroup, AWS::RDS::DescribeDBLogFiles, AWS::RDS::DescribeDBParameterGroups, AWS::RDS::DescribeDBParameters, AWS::RDS::DescribeDBReservedInstances, AWS::RDS::DescribeOrderableDBInstanceOptions, AWS::RDS::DownloadDBLogFilePortion, AWS::RDS::ModifyDbParameterGroup, AWS::RDS::SecurityGroupParser, AWS::RDS::SnapshotParser, AWS::RDS::SubnetGroupParser, AWS::RDS::TagListParser, AWS::SES::DeleteVerifiedEmailAddress, AWS::SES::GetSendQuota, AWS::SES::GetSendStatistics, AWS::SES::ListVerifiedEmailAddresses, AWS::SES::SendEmail, AWS::SES::SendRawEmail, AWS::SES::VerifyDomainIdentity, AWS::SES::VerifyEmailAddress, AWS::SNS::AddPermission, AWS::SNS::ConfirmSubscription, AWS::SNS::CreateTopic, AWS::SNS::DeleteTopic, AWS::SNS::GetTopicAttributes, AWS::SNS::ListSubscriptions, AWS::SNS::ListTopics, AWS::SNS::Publish, AWS::SNS::RemovePermission, AWS::SNS::SetTopicAttributes, AWS::SNS::Subscribe, AWS::SNS::Unsubscribe, AWS::SQS::Basic, AWS::SQS::CreateQueue, AWS::SQS::GetQueueAttributes, AWS::SQS::ListQueues, AWS::SQS::ReceiveMessage, AWS::SQS::SendMessage, AWS::STS::AssumeRole, AWS::STS::GetSessionToken, AWS::SimpleDB::Basic, CDN::AWS::Distribution, CDN::AWS::GetDistributionList, CDN::AWS::GetInvalidation, CDN::AWS::GetInvalidationList, CDN::AWS::GetStreamingDistributionList, CDN::AWS::PostInvalidation, CDN::AWS::StreamingDistribution, Compute::AWS::AllocateAddress, Compute::AWS::AssignPrivateIpAddresses, Compute::AWS::AssociateAddress, Compute::AWS::AssociateRouteTable, Compute::AWS::AttachNetworkInterface, Compute::AWS::AttachVolume, Compute::AWS::Basic, Compute::AWS::CancelSpotInstanceRequests, Compute::AWS::CopyImage, Compute::AWS::CopySnapshot, Compute::AWS::CreateDhcpOptions, Compute::AWS::CreateImage, Compute::AWS::CreateInternetGateway, Compute::AWS::CreateKeyPair, Compute::AWS::CreateRouteTable, Compute::AWS::CreateSecurityGroup, Compute::AWS::CreateSnapshot, Compute::AWS::CreateSubnet, Compute::AWS::CreateVolume, Compute::AWS::CreateVpc, Compute::AWS::DeregisterImage, Compute::AWS::DescribeAccountAttributes, Compute::AWS::DescribeAddresses, Compute::AWS::DescribeAvailabilityZones, Compute::AWS::DescribeDhcpOptions, Compute::AWS::DescribeImages, Compute::AWS::DescribeInstanceStatus, Compute::AWS::DescribeInstances, Compute::AWS::DescribeInternetGateways, Compute::AWS::DescribeKeyPairs, Compute::AWS::DescribePlacementGroups, Compute::AWS::DescribeRegions, Compute::AWS::DescribeReservedInstances, Compute::AWS::DescribeReservedInstancesOfferings, Compute::AWS::DescribeRouteTables, Compute::AWS::DescribeSecurityGroups, Compute::AWS::DescribeSnapshots, Compute::AWS::DescribeSpotPriceHistory, Compute::AWS::DescribeSubnets, Compute::AWS::DescribeTags, Compute::AWS::DescribeVolumeStatus, Compute::AWS::DescribeVolumes, Compute::AWS::DescribeVpcs, Compute::AWS::DetachVolume, Compute::AWS::GetConsoleOutput, Compute::AWS::GetPasswordData, Compute::AWS::ImportKeyPair, Compute::AWS::MonitorUnmonitorInstances, Compute::AWS::NetworkAclParser, Compute::AWS::NetworkInterfaceParser, Compute::AWS::PurchaseReservedInstancesOffering, Compute::AWS::RegisterImage, Compute::AWS::ReplaceNetworkAclAssociation, Compute::AWS::RunInstances, Compute::AWS::SpotDatafeedSubscription, Compute::AWS::SpotInstanceRequests, Compute::AWS::StartStopInstances, Compute::AWS::TerminateInstances, Compute::Voxel::Basic, Compute::Voxel::DevicesList, Compute::Voxel::ImagesList, Compute::Voxel::VoxcloudCreate, Compute::Voxel::VoxcloudDelete, Compute::Voxel::VoxcloudStatus, DNS::AWS::ChangeResourceRecordSets, DNS::AWS::CreateHostedZone, DNS::AWS::DeleteHostedZone, DNS::AWS::GetChange, DNS::AWS::GetHostedZone, DNS::AWS::ListHostedZones, DNS::AWS::ListResourceRecordSets, DNS::Bluebox::CreateRecord, DNS::Bluebox::CreateZone, DNS::Bluebox::GetRecord, DNS::Bluebox::GetRecords, DNS::Bluebox::GetZone, DNS::Bluebox::GetZones, DNS::Zerigo::CountHosts, DNS::Zerigo::CountZones, DNS::Zerigo::CreateHost, DNS::Zerigo::CreateZone, DNS::Zerigo::FindHosts, DNS::Zerigo::GetHost, DNS::Zerigo::GetZone, DNS::Zerigo::GetZoneStats, DNS::Zerigo::ListHosts, DNS::Zerigo::ListZones, Redshift::AWS::ClusterParser, Redshift::AWS::ClusterSecurityGroupParser, Redshift::AWS::ClusterSnapshotParser, Redshift::AWS::ClusterSubnetGroupParser, Redshift::AWS::CreateClusterParameterGroup, Redshift::AWS::DescribeClusterParameterGroups, Redshift::AWS::DescribeClusterParameters, Redshift::AWS::DescribeClusterSubnetGroups, Redshift::AWS::DescribeClusterVersions, Redshift::AWS::DescribeDefaultClusterParameters, Redshift::AWS::DescribeEvents, Redshift::AWS::DescribeOrderableClusterOptions, Redshift::AWS::DescribeReservedNodeOfferings, Redshift::AWS::DescribeReservedNodes, Redshift::AWS::DescribeResize, Redshift::AWS::PurchaseReservedNodeOffering, Redshift::AWS::UpdateClusterParameterGroupParser, Storage::AWS::AccessControlList, Storage::AWS::CompleteMultipartUpload, Storage::AWS::CopyObject, Storage::AWS::CorsConfiguration, Storage::AWS::DeleteMultipleObjects, Storage::AWS::GetBucket, Storage::AWS::GetBucketLifecycle, Storage::AWS::GetBucketLocation, Storage::AWS::GetBucketLogging, Storage::AWS::GetBucketObjectVersions, Storage::AWS::GetBucketTagging, Storage::AWS::GetBucketVersioning, Storage::AWS::GetBucketWebsite, Storage::AWS::GetRequestPayment, Storage::AWS::GetService, Storage::AWS::InitiateMultipartUpload, Storage::AWS::ListMultipartUploads, Storage::AWS::ListParts, Storage::Google::AccessControlList, Storage::Google::CopyObject, Storage::Google::GetBucket, Storage::Google::GetBucketObjectVersions, Storage::Google::GetBucketVersioning, Storage::Google::GetRequestPayment, Storage::Google::GetService, Storage::InternetArchive::AccessControlList, Storage::InternetArchive::CompleteMultipartUpload, Storage::InternetArchive::CopyObject, Storage::InternetArchive::CorsConfiguration, Storage::InternetArchive::DeleteMultipleObjects, Storage::InternetArchive::GetBucket, Storage::InternetArchive::GetBucketLifecycle, Storage::InternetArchive::GetBucketLocation, Storage::InternetArchive::GetBucketLogging, Storage::InternetArchive::GetBucketWebsite, Storage::InternetArchive::GetRequestPayment, Storage::InternetArchive::GetService, Storage::InternetArchive::InitiateMultipartUpload, Storage::InternetArchive::ListMultipartUploads, Storage::InternetArchive::ListParts, TerremarkParser, VcloudDirectorParser

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Base) initialize

Returns a new instance of Base



9
10
11
# File 'lib/fog/core/parser.rb', line 9

def initialize
  reset
end

Instance Attribute Details

- (Object) response (readonly)

Returns the value of attribute response



7
8
9
# File 'lib/fog/core/parser.rb', line 7

def response
  @response
end

Instance Method Details

- (Object) attr_value(name, attrs)



13
14
15
# File 'lib/fog/core/parser.rb', line 13

def attr_value(name, attrs)
  (entry = attrs.detect {|a, v| a == name }) && entry.last
end

- (Object) characters(string)



21
22
23
24
# File 'lib/fog/core/parser.rb', line 21

def characters(string)
  @value ||= ''
  @value << string
end

- (Object) end_element_namespace(name, prefix = nil, uri = nil)



33
34
35
# File 'lib/fog/core/parser.rb', line 33

def end_element_namespace name, prefix = nil, uri = nil
  end_element name
end

- (Object) reset



17
18
19
# File 'lib/fog/core/parser.rb', line 17

def reset
  @response = {}
end

- (Object) start_element(name, attrs = [])

###############################################################################



39
40
41
# File 'lib/fog/core/parser.rb', line 39

def start_element(name, attrs = [])
  @value = nil
end

- (Object) start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])

############################################################################### This is a workaround. Original implementation from Nokogiri is overwritten with one that does not join namespace prefix with local name.



29
30
31
# File 'lib/fog/core/parser.rb', line 29

def start_element_namespace name, attrs = [], prefix = nil, uri = nil, ns = []
  start_element name, attrs
end

- (Object) value



43
44
45
# File 'lib/fog/core/parser.rb', line 43

def value
  @value && @value.dup
end