Class: IControl::Base::Struct

Inherits:
Object
  • Object
show all
Defined in:
lib/icontrol/base/struct.rb

Direct Known Subclasses

ARX::ExportDefinition, ARX::FileChangeDefinition, ARX::FileChangeResponse, ARX::FileServerDefinition, ARX::HAStatus, ARX::HealthDefinition, ARX::NamespaceDefinition, ARX::NetworkDefinition, ARX::NetworkStats, ARX::PolicyDefinition, ARX::PolicySchedule, ARX::ProcessorStats, ARX::ProtocolDefinition, ARX::ShareDefinition, ARX::SnapshotDefinition, ARX::StorageStatus, ARX::VirtualServiceDefinition, ARX::VirtualServiceStats, ARX::VolumeDefinition, ASM::ApplyLearning, ASM::DynamicSessionsInUrl, ASM::FileTransferContext, ASM::ObjectParams::AttackSignatureDefinition, ASM::ObjectParams::MetacharDefinition, ASM::ObjectTypeType, ASM::SignatureFileUpdateReturnValue, ASM::Violation, ASM::ViolationSeverity, ASM::WebApplicationGroupDefinition, ASM::WebObjectType, Common::Expiration, Common::IPHost, Common::IPNetmask, Common::IPPortDefinition, Common::KeyValue, Common::Long64, Common::ObjectStatus, Common::Statistic, Common::TimeStamp, Common::TimeZone, Common::ULong64, Common::VLANFilterList, Common::VirtualServerDefinition, GlobalLB::Application::ApplicationContextObject, GlobalLB::DataCenter::DataCenterAttribute, GlobalLB::DataCenter::DataCenterLinkDefinition, GlobalLB::DataCenter::DataCenterServerDefinition, GlobalLB::DataCenter::DataCenterStatisticEntry, GlobalLB::DataCenter::DataCenterStatistics, GlobalLB::Link::LinkCostSegment, GlobalLB::Link::LinkIPDefinition, GlobalLB::Link::LinkMetricLimit, GlobalLB::Link::LinkStatisticEntry, GlobalLB::Link::LinkStatistics, GlobalLB::Link::MonitorAssociation, GlobalLB::MetricLimit, GlobalLB::Monitor::CommonAttributes, GlobalLB::Monitor::IntegerValue, GlobalLB::Monitor::MonitorTemplate, GlobalLB::Monitor::StringValue, GlobalLB::Monitor::UserDefinedStringValue, GlobalLB::MonitorIPPort, GlobalLB::MonitorInstance, GlobalLB::MonitorInstanceState, GlobalLB::MonitorRule, GlobalLB::Pool::MonitorAssociation, GlobalLB::Pool::PoolMemberDefinition, GlobalLB::Pool::PoolMetricLimit, GlobalLB::Pool::PoolStatisticEntry, GlobalLB::Pool::PoolStatistics, GlobalLB::PoolMember::MemberDependency, GlobalLB::PoolMember::MemberEnabledState, GlobalLB::PoolMember::MemberMetricLimit, GlobalLB::PoolMember::MemberMonitorAssociation, GlobalLB::PoolMember::MemberMonitorAssociationRemoval, GlobalLB::PoolMember::MemberObjectStatus, GlobalLB::PoolMember::MemberOrder, GlobalLB::PoolMember::MemberRatio, GlobalLB::PoolMember::MemberStatisticEntry, GlobalLB::PoolMember::MemberStatistics, GlobalLB::Region::RegionDefinition, GlobalLB::Region::RegionItem, GlobalLB::Rule::RuleDefinition, GlobalLB::Rule::RuleStatisticEntry, GlobalLB::Rule::RuleStatistics, GlobalLB::Server::MonitorAssociation, GlobalLB::Server::ServerIPDefinition, GlobalLB::Server::ServerIPsForUnitID, GlobalLB::Server::ServerMetricLimit, GlobalLB::Server::ServerStatisticEntry, GlobalLB::Server::ServerStatistics, GlobalLB::Topology::TopologyEndpoint, GlobalLB::Topology::TopologyRecord, GlobalLB::VirtualServer::MonitorAssociation, GlobalLB::VirtualServer::VirtualServerMetricLimit, GlobalLB::VirtualServer::VirtualServerStatisticEntry, GlobalLB::VirtualServer::VirtualServerStatistics, GlobalLB::VirtualServerDefinition, GlobalLB::WideIP::WideIPPool, GlobalLB::WideIP::WideIPRule, GlobalLB::WideIP::WideIPStatisticEntry, GlobalLB::WideIP::WideIPStatistics, LTConfig::ClassInstanceKey, LocalLB::Klass::AddressClass, LocalLB::Klass::AddressEntry, LocalLB::Klass::MetaInformation, LocalLB::Klass::StringClass, LocalLB::Klass::ValueClass, LocalLB::MatchPatternString, LocalLB::Monitor::CommonAttributes, LocalLB::Monitor::IntegerValue, LocalLB::Monitor::MonitorTemplate, LocalLB::Monitor::StringValue, LocalLB::Monitor::UserDefinedStringValue, LocalLB::MonitorIP, LocalLB::MonitorIPPort, LocalLB::MonitorInstance, LocalLB::MonitorInstanceState, LocalLB::MonitorRule, LocalLB::NAT::NATDefinition, LocalLB::NAT::NATStatisticEntry, LocalLB::NAT::NATStatistics, LocalLB::NodeAddress::MonitorAssociation, LocalLB::NodeAddress::MonitorAssociationRemoval, LocalLB::NodeAddress::NodeAddressStatisticEntry, LocalLB::NodeAddress::NodeAddressStatistics, LocalLB::ObjectStatus, LocalLB::PersistenceRecord, LocalLB::Pool::MonitorAssociation, LocalLB::Pool::PoolStatisticEntry, LocalLB::Pool::PoolStatistics, LocalLB::PoolMember::MemberConnectionLimit, LocalLB::PoolMember::MemberDynamicRatio, LocalLB::PoolMember::MemberMonitorAssociation, LocalLB::PoolMember::MemberMonitorAssociationRemoval, LocalLB::PoolMember::MemberMonitorInstanceState, LocalLB::PoolMember::MemberMonitorState, LocalLB::PoolMember::MemberMonitorStatus, LocalLB::PoolMember::MemberObjectStatus, LocalLB::PoolMember::MemberPriority, LocalLB::PoolMember::MemberRatio, LocalLB::PoolMember::MemberSessionState, LocalLB::PoolMember::MemberSessionStatus, LocalLB::PoolMember::MemberStatisticEntry, LocalLB::PoolMember::MemberStatistics, LocalLB::ProfileAuth::ProfileAuthStatisticEntry, LocalLB::ProfileAuth::ProfileAuthStatistics, LocalLB::ProfileAuthenticationMethod, LocalLB::ProfileClientSSL::ProfileClientSSLStatisticEntry, LocalLB::ProfileClientSSL::ProfileClientSSLStatistics, LocalLB::ProfileClientSSLCertificateMode, LocalLB::ProfileCompressionMethod, LocalLB::ProfileCookiePersistenceMethod, LocalLB::ProfileCredentialSource, LocalLB::ProfileDNS::ProfileDNSStatisticEntry, LocalLB::ProfileDNS::ProfileDNSStatistics, LocalLB::ProfileDiameter::ProfileDiameterStatisticEntry, LocalLB::ProfileDiameter::ProfileDiameterStatistics, LocalLB::ProfileEnabledState, LocalLB::ProfileFTP::ProfileFTPStatisticEntry, LocalLB::ProfileFTP::ProfileFTPStatistics, LocalLB::ProfileFastHttp::ProfileFastHttpStatisticEntry, LocalLB::ProfileFastHttp::ProfileFastHttpStatistics, LocalLB::ProfileFastL4::ProfileFastL4StatisticEntry, LocalLB::ProfileFastL4::ProfileFastL4Statistics, LocalLB::ProfileHardwareAccelerationMode, LocalLB::ProfileHttp::ProfileHttpStatisticEntry, LocalLB::ProfileHttp::ProfileHttpStatistics, LocalLB::ProfileHttpChunkMode, LocalLB::ProfileHttpClass::ProfileHttpClassStatisticEntry, LocalLB::ProfileHttpClass::ProfileHttpClassStatistics, LocalLB::ProfileHttpCompressionMode, LocalLB::ProfileHttpRedirectRewriteMode, LocalLB::ProfileIIOP::ProfileIIOPStatisticEntry, LocalLB::ProfileIIOP::ProfileIIOPStatistics, LocalLB::ProfileIPAddress, LocalLB::ProfileMatchPatternStringArray, LocalLB::ProfileOneConnect::ProfileOneConnectStatisticEntry, LocalLB::ProfileOneConnect::ProfileOneConnectStatistics, LocalLB::ProfilePersistence::ProfilePersistenceHashMethod, LocalLB::ProfilePersistenceMode, LocalLB::ProfilePortNumber, LocalLB::ProfileProfileMode, LocalLB::ProfileRADIUS::ProfileRADIUSStatisticEntry, LocalLB::ProfileRADIUS::ProfileRADIUSStatistics, LocalLB::ProfileRTSP::ProfileRTSPStatisticEntry, LocalLB::ProfileRTSP::ProfileRTSPStatistics, LocalLB::ProfileRamCacheCacheControlMode, LocalLB::ProfileRtspProxyType, LocalLB::ProfileSCTP::ProfileSCTPStatisticEntry, LocalLB::ProfileSCTP::ProfileSCTPStatistics, LocalLB::ProfileSIP::ProfileSIPStatisticEntry, LocalLB::ProfileSIP::ProfileSIPStatistics, LocalLB::ProfileSSLOption, LocalLB::ProfileServerSSL::ProfileServerSSLStatisticEntry, LocalLB::ProfileServerSSL::ProfileServerSSLStatistics, LocalLB::ProfileServerSSLCertificateMode, LocalLB::ProfileStream::ProfileStreamStatisticEntry, LocalLB::ProfileStream::ProfileStreamStatistics, LocalLB::ProfileString, LocalLB::ProfileStringArray, LocalLB::ProfileTCP::ProfileTCPStatisticEntry, LocalLB::ProfileTCP::ProfileTCPStatistics, LocalLB::ProfileTCPCongestionControlMode, LocalLB::ProfileTCPOptionMode, LocalLB::ProfileUDP::ProfileUDPStatisticEntry, LocalLB::ProfileUDP::ProfileUDPStatistics, LocalLB::ProfileULong, LocalLB::ProfileUShort, LocalLB::ProfileUncleanShutdownMode, LocalLB::ProfileUserStatistic::ProfileUserStatisticStatisticEntry, LocalLB::ProfileUserStatistic::ProfileUserStatisticStatistics, LocalLB::ProfileUserStatistic::UserStatistic, LocalLB::ProfileUserStatistic::UserStatisticName, LocalLB::ProfileXML::NamespaceMapping, LocalLB::ProfileXML::ProfileNamespaceMappingSequence, LocalLB::ProfileXML::ProfileXMLStatisticEntry, LocalLB::ProfileXML::ProfileXMLStatistics, LocalLB::RAMCacheInformation::RAMCacheEntry, LocalLB::RAMCacheInformation::RAMCacheEntryExactMatch, LocalLB::RAMCacheInformation::RAMCacheKey, LocalLB::RateClass::RateClassStatisticEntry, LocalLB::RateClass::RateClassStatistics, LocalLB::RateClass::RateUnit, LocalLB::Rule::RuleDefinition, LocalLB::Rule::RuleStatisticEntry, LocalLB::Rule::RuleStatistics, LocalLB::SNAT::SNATDefinition, LocalLB::SNAT::SNATOriginalAddress, LocalLB::SNAT::SNATStatisticEntry, LocalLB::SNAT::SNATStatistics, LocalLB::SNAT::Translation, LocalLB::SNATPool::SNATPoolStatisticEntry, LocalLB::SNATPool::SNATPoolStatistics, LocalLB::SNATPoolMember::SNATPoolMemberStatisticEntry, LocalLB::SNATPoolMember::SNATPoolMemberStatistics, LocalLB::SNATTranslationAddress::SNATTranslationAddressStatisticEntry, LocalLB::SNATTranslationAddress::SNATTranslationAddressStatistics, LocalLB::VirtualAddress::VirtualAddressStatisticEntry, LocalLB::VirtualAddress::VirtualAddressStatistics, LocalLB::VirtualServer::VirtualServerAuthentication, LocalLB::VirtualServer::VirtualServerClonePool, LocalLB::VirtualServer::VirtualServerHttpClass, LocalLB::VirtualServer::VirtualServerModuleScore, LocalLB::VirtualServer::VirtualServerPersistence, LocalLB::VirtualServer::VirtualServerProfile, LocalLB::VirtualServer::VirtualServerProfileAttribute, LocalLB::VirtualServer::VirtualServerResource, LocalLB::VirtualServer::VirtualServerRule, LocalLB::VirtualServer::VirtualServerStatisticEntry, LocalLB::VirtualServer::VirtualServerStatistics, Management::A6Record, Management::AAAARecord, Management::ARecord, Management::CCLDAPConfiguration::LDAPSearchOption, Management::CNAMERecord, Management::CRLDPServer::CRLDPServerDefinition, Management::ChangeControl::ClassInfo, Management::ChangeControl::ClassTransactionInfo, Management::ChangeControl::DeprecatedClassInfo, Management::ChangeControl::Instance, Management::ChangeControl::InstanceInfo, Management::ChangeControl::InstanceVariable, Management::ChangeControl::ModuleInfo, Management::DBVariable::VariableNameValue, Management::DNAMERecord, Management::EventNotification::EventData, Management::EventNotification::EventDataItem, Management::EventNotification::EventSource, Management::EventSubscription::SubscriptionDefinition, Management::EventSubscription::SubscriptionDetails, Management::EventSubscription::SubscriptionStatistics, Management::EventSubscription::SubscriptionStatus, Management::EventSubscription::UserCredential, Management::HINFORecord, Management::KEYRecord, Management::KeyCertificate::Certificate, Management::KeyCertificate::CertificateDetail, Management::KeyCertificate::CertificateInformation, Management::KeyCertificate::CertificateRequest, Management::KeyCertificate::CertificateRequestInformation, Management::KeyCertificate::Key, Management::KeyCertificate::KeyInformation, Management::KeyCertificate::X509Data, Management::LicenseAdministration::EvaluationExpiration, Management::LicenseAdministration::ModuleExpiry, Management::LicenseAdministration::ModuleKey, Management::LicenseAdministration::ModuleKeyTimeLimits, Management::LicenseAdministration::TimeLimitedModuleKey, Management::MXRecord, Management::NSRecord, Management::NXTRecord, Management::OCSPResponder::ResponderDefinition, Management::OCSPResponder::SignInformation, Management::PTRRecord, Management::Partition::AuthZPartition, Management::RADIUSServer::RADIUSServerDefinition, Management::RRList, Management::SIGRecord, Management::SNMPConfiguration::AccessInformation, Management::SNMPConfiguration::AgentInterface, Management::SNMPConfiguration::AgentListenAddressPort, Management::SNMPConfiguration::AgentXInformation, Management::SNMPConfiguration::ClientAccess, Management::SNMPConfiguration::DiskCheckInformation, Management::SNMPConfiguration::DynamicLoadableModule, Management::SNMPConfiguration::FileCheckInformation, Management::SNMPConfiguration::GenericSinkInformation, Management::SNMPConfiguration::GenericSinkInformation2, Management::SNMPConfiguration::GroupInformation, Management::SNMPConfiguration::LoadAverageInformation, Management::SNMPConfiguration::MibnumNameProgArgs, Management::SNMPConfiguration::NameProgArgs, Management::SNMPConfiguration::PassThroughInformation, Management::SNMPConfiguration::ProcessInformation, Management::SNMPConfiguration::ProxyInformation, Management::SNMPConfiguration::SecurityInformation, Management::SNMPConfiguration::SinkInformation, Management::SNMPConfiguration::SmuxSubAgentInformation, Management::SNMPConfiguration::SystemInformation, Management::SNMPConfiguration::UserInformation, Management::SNMPConfiguration::ViewInformation, Management::SNMPConfiguration::WrapperSecurityInformation, Management::SNMPConfiguration::WrapperUserInformation, Management::SOARecord, Management::SRVRecord, Management::StatementDefinition, Management::TXTRecord, Management::UserManagement::PasswordInfo, Management::UserManagement::UserID, Management::UserManagement::UserInfo, Management::UserManagement::UserInfo2, Management::UserManagement::UserInfo3, Management::UserManagement::UserPermission, Management::ViewInfo, Management::ViewZone, Management::ZoneInfo, Networking::ARP::ARPEntry, Networking::ARP::ARPStatistics, Networking::ARP::NDPEntry, Networking::ARP::NDPStatistics, Networking::ARP::StaticEntry, Networking::ISessionAdvertisedRoute::ISessionAdvertisedRouteStruct, Networking::ISessionAdvertisedRoute::SubnetOptKey, Networking::Interfaces::InterfaceMediaOption, Networking::Interfaces::InterfaceStatisticEntry, Networking::Interfaces::InterfaceStatistics, Networking::PacketFilter::PacketFilterStatisticEntry, Networking::PacketFilter::PacketFilterStatistics, Networking::ProfileWCCPGRE::ProfileWCCPGREForwarding, Networking::RouteTable::DynamicRoute, Networking::RouteTable::DynamicRouteStatistics, Networking::RouteTable::RouteAttribute, Networking::RouteTable::RouteDefinition, Networking::RouteTable::RouteTableMetricEntry, Networking::RouteTable::RouteTableMetricStatistics, Networking::STPInstance::InterfacePathCost, Networking::STPInstance::InterfacePriority, Networking::STPInstance::InterfaceSTPRole, Networking::STPInstance::InterfaceSTPState, Networking::STPInstance::PathCost, Networking::SelfIPPortLockdown::ProtocolPort, Networking::SelfIPPortLockdown::SelfIPAccess, Networking::Trunk::TrunkStatisticEntry, Networking::Trunk::TrunkStatistics, Networking::Uuid_128, Networking::VLAN::ForwardingTableEntry, Networking::VLAN::MemberEntry, System::BladeTemperature, System::CPUMetric, System::CPUUsage, System::CPUUsageExtended, System::CPUUsageExtendedInformation, System::CPUUsageInformation, System::ConfigSync::ConfigFileEntry, System::ConfigSync::FileTransferContext, System::ConnectionInformation, System::Connections::ActiveConnection, System::Connections::ConnectionID, System::Disk::LogicalDisk, System::DiskUsage, System::DiskUsageInformation, System::FanMetric, System::GlobalCPUUsageExtendedInformation, System::HardwareInformation, System::Internal::URI, System::LockStatus, System::MemoryUsageInformation, System::PSMetric, System::PlatformCPUs, System::PlatformFans, System::PlatformPowerSupplies, System::PlatformTemperatures, System::ProductInformation, System::Services::SSHAccess, System::Services::SSHAccess_v2, System::Services::ServiceStatus, System::SoftwareManagement::HotFixInformation, System::SoftwareManagement::InstallationID, System::SoftwareManagement::RepositoryImageID, System::SoftwareManagement::SoftwareRepositoryHotfix, System::SoftwareManagement::SoftwareRepositoryImage, System::SoftwareManagement::SoftwareStatus, System::Statistics::GlobalHostStatistics, System::Statistics::GlobalTMMStatistics, System::Statistics::GtmIQueryStatisticEntry, System::Statistics::GtmIQueryStatistics, System::Statistics::GtmLdnsStatisticEntry, System::Statistics::GtmLdnsStatistics, System::Statistics::GtmPathStatisticEntry, System::Statistics::GtmPathStatisticObjectID, System::Statistics::GtmPathStatistics, System::Statistics::HostStatisticEntry, System::Statistics::HostStatistics, System::Statistics::PVAStatisticEntry, System::Statistics::PVAStatistics, System::Statistics::PerformanceGraph, System::Statistics::PerformanceGraphDataCSV, System::Statistics::PerformanceStatisticQuery, System::Statistics::PerformanceTable, System::Statistics::PerformanceTableData, System::Statistics::SystemStatistics, System::Statistics::TMMStatisticEntry, System::Statistics::TMMStatistics, System::Statistics::VirtualCompressionStatisticEntry, System::Statistics::VirtualCompressionStatistics, System::SubsystemMemoryUsage, System::SystemInformation, System::TemperatureMetric, System::VersionInformation

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.attributesObject

Returns the value of attribute attributes



9
10
11
# File 'lib/icontrol/base/struct.rb', line 9

def attributes
  @attributes
end

Class Method Details

.from_soap(xml) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/icontrol/base/struct.rb', line 23

def from_soap(xml)
  aux = {}
  @attributes.each do |k,v|
    
    if v.respond_to?(:from_soap) # v.ancestors.find{ |i| i.name  =~ /^IControl/ }              
      aux[k] = v.from_soap(xml[k])
    else
      if v == Numeric
        aux[k] = xml[k].to_i
      else
        if xml[k].empty_node?
          aux[k] = nil
        else
          aux[k] = xml[k]
        end
      end
    end
  end if xml
  return aux.values.compact.empty? ? nil : self.new(aux)
end

.icontrol_attribute(attribute, klass, soap_attribute_name = nil) ⇒ Object

When defining an struct we have to indicate every attribute type cause the soap responses are typed This method accepts three arguments:

attribute           = The name the atribute is going to be referenced in the instances (i.e. the ruby name)
klass               = The Ruby class of the attribute
soap_attribute_name = The soap name of the attribute in case it differs from the attribute name (DEPRECATED)


18
19
20
21
# File 'lib/icontrol/base/struct.rb', line 18

def icontrol_attribute(attribute,klass,soap_attribute_name = nil)
  @attributes ||= {}
  @attributes[attribute] = klass 
end

Instance Method Details

#to_soapObject

Converts to soap. In this case we fallback to the hash conversion of the attributes



47
48
49
50
51
# File 'lib/icontrol/base/struct.rb', line 47

def to_soap
  aux = {}
  @attributes.each {|k,v| aux[k.to_s] = v.respond_to?(:to_soap) ? v.to_soap : v }
  return aux
end