Beispiel #1
0
 def setUpClass(cls):
     cls.limits_json = \
         """
         {
           "limits" : {
             "rate" : [
               {
                 "regex" : "/v[^/]/(\\d+)/?.*",
                 "uri" : "*",
                 "limit" : [
                   {
                     "next-available" : "2013-08-20T17:10:28.995Z",
                     "unit" : "MINUTE",
                     "remaining" : 1999,
                     "value" : 2000,
                     "verb" : "GET"
                   },
                   {
                     "next-available" : "2013-08-20T17:10:03.071Z",
                     "unit" : "MINUTE",
                     "remaining" : 200,
                     "value" : 200,
                     "verb" : "POST"
                   }
                 ]
               }
             ],
             "absolute" : {
               "maxServerMeta" : 40,
               "maxPersonality" : 5,
               "totalPrivateNetworksUsed" : 0,
               "maxImageMeta" : 40,
               "maxPersonalitySize" : 1000,
               "maxSecurityGroupRules" : 20,
               "maxTotalKeypairs" : 100,
               "totalCoresUsed" : 9,
               "totalRAMUsed" : 31232,
               "totalInstancesUsed" : 2,
               "maxSecurityGroups" : 10,
               "totalFloatingIpsUsed" : 0,
               "maxTotalCores" : -1,
               "totalSecurityGroupsUsed" : 0,
               "maxTotalPrivateNetworks" : 6,
               "maxTotalFloatingIps" : 5,
               "maxTotalInstances" : 100,
               "maxTotalRAMSize" : 650000
             }
           }
         }
         """
     cls.limits = TenantLimits.deserialize(cls.limits_json, 'json')
Beispiel #2
0
 def setUpClass(cls):
     docs_url = 'http://docs.openstack.org'
     cls.limits_xml = \
         """
         <limits xmlns:lim="{docs_url}/common/api/v1.0"
         xmlns="{docs_url}/common/api/v1.0">
         <rates>
         <rate regex="/v[^/]/(\d+)/?.*" uri="*">
         <limit next-available="2013-08-20T17:10:28.995Z" unit="MINUTE"
         remaining="1999" value="2000" verb="GET"/>
         <limit next-available="2013-08-20T17:10:03.071Z" unit="MINUTE"
         remaining="200" value="200" verb="POST"/>
         </rate>
         </rates>
         <absolute
         xmlns:os-used-limits="{docs_url}/compute/ext/used_limits/api/v1.1"
         xmlns:atom="http://www.w3.org/2005/Atom">
         <limit name="maxServerMeta" value="40"/>
         <limit name="maxPersonality" value="5"/>
         <limit name="totalPrivateNetworksUsed" value="0"/>
         <limit name="maxImageMeta" value="40"/>
         <limit name="maxPersonalitySize" value="1000"/>
         <limit name="maxSecurityGroupRules" value="20"/>
         <limit name="maxTotalKeypairs" value="100"/>
         <limit name="totalCoresUsed" value="9"/>
         <limit name="totalRAMUsed" value="31232"/>
         <limit name="totalInstancesUsed" value="2"/>
         <limit name="maxSecurityGroups" value="10"/>
         <limit name="totalFloatingIpsUsed" value="0"/>
         <limit name="maxTotalCores" value="-1"/>
         <limit name="totalSecurityGroupsUsed" value="0"/>
         <limit name="maxTotalPrivateNetworks" value="6"/>
         <limit name="maxTotalFloatingIps" value="5"/>
         <limit name="maxTotalInstances" value="100"/>
         <limit name="maxTotalRAMSize" value="650000"/>
         </absolute>
         </limits>
         """.format(docs_url=docs_url)
     cls.limits = TenantLimits.deserialize(cls.limits_xml, 'xml')