fgcp.dummy
index
dummy.py

Dummy Fujitsu Global Cloud Platform (FGCP) API Server(s) for local tests
 
Example: [see tests/test_*.py for more examples]
 
# Connect without client certificate to region 'test'
from fgcp.resource import FGCPVDataCenter
vdc = FGCPVDataCenter('client.pem', 'test')
 
# Do typical resource actions - updates are not supported here
vsystem = vdc.get_vsystem('Demo System')
vsystem.show_status()
for vserver in vsystem.vservers:
    #result = vserver.backup(wait=True)
...
 
Note: you need to unzip the file 'fixtures.zip' in tests/fixtures first

 
Modules
       
os
re
time

 
Classes
       
fgcp.FGCPError(exceptions.Exception)
FGCPDummyError
FGCPFakeServerWithRegistry
FGCPTestServerWithFixtures

 
class FGCPDummyError(fgcp.FGCPError)
    
Method resolution order:
FGCPDummyError
fgcp.FGCPError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods inherited from fgcp.FGCPError:
__init__(self, status, message)
__str__(self)

Data descriptors inherited from fgcp.FGCPError:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x1E1CCBE8>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class FGCPFakeServerWithRegistry
    

 
class FGCPTestServerWithFixtures
    Test API server for local tests - updates are not supported
 
>>> from fgcp.client import FGCPClient
>>> client = FGCPClient('client.pem', 'test')
>>> client.ShowSystemStatus('Python API Demo System')
Show System Status for VSYS Python API Demo System
VSYS:Python API Demo System:NORMAL
PublicIP:80.70.163.238:ATTACHED
EFM FW:Firewall:RUNNING
EFM SLB:LoadBalancer:192.168.3.211:RUNNING
VServer:Server1:192.168.3.12:RUNNING
VServer:Server2:192.168.3.13:RUNNING
VServer:Server3:192.168.4.12:RUNNING
VServer:Server4:192.168.4.13:RUNNING
.
 
  Methods defined here:
__init__(self, *args, **kwargs)
close(self)
getresponse(self)
read(self)
request(self, method, uri, body, headers)
save_request(self, testid, body)
save_response(self, testid, data)
set_testid(self, testid)

Data and other attributes defined here:
reason = 'OK'
status = 200