fgcp.command
index
command.py

API Commands to the Fujitsu Global Cloud Platform (FGCP)
 
Example: [see tests/test_api.py for more examples]
 
# Connect with your client certificate to region 'uk'
from fgcp.command import FGCPCommand
api_proxy = FGCPCommand('client.pem', 'uk')
 
# Call standard API commands with identifiers
vsystems = api_proxy.ListVSYS()
for vsys in vsystems:
    status = api_proxy.GetVSYSStatus(vsys.vsysId)
    vsysconfig = api_proxy.GetVSYSConfiguration(vsys.vsysId)
    for vserver in vsysconfig.vservers:
        status = api_proxy.GetVServerStatus(vsys.vsysId, vserver.vserverId)
    ...

 
Classes
       
fgcp.FGCPError(exceptions.Exception)
FGCPCommandError
fgcp.connection.FGCPProxyServer(fgcp.connection.FGCPConnection)
FGCPCommand
future.types.newobject.newobject(__builtin__.object)
FGCPGenericEFMHandler
FGCPGetEFMConfigHandler
FGCPUpdateEFMConfigHandler

 
class FGCPCommand(fgcp.connection.FGCPProxyServer)
    Proxy for FGCP API Commands
 
 
Method resolution order:
FGCPCommand
fgcp.connection.FGCPProxyServer
fgcp.connection.FGCPConnection
future.types.newobject.newobject
__builtin__.object

Methods defined here:
AddAddressRange(self, pipFrom, pipTo)
AllocatePublicIP(self, vsysId)
AttachPublicIP(self, vsysId, publicIp)
AttachVDisk(self, vsysId, vserverId, vdiskId)
BackupEFM(self, vsysId, efmId)
BackupVDisk(self, vsysId, vdiskId)
CheckUserIDAvailability(self, userIds)
Usage: usersinfo = proxy.CheckUserIDAvailability(userIds)
CopyDiskImage(self, diskImageId, key, timeZone=None, countryCode=None)
Usage: diskimageId = proxy.CopyDiskImage(diskImageId, key)
CopyVSYSDescriptor(self, vsysDescriptorId, key, timeZone=None, countryCode=None)
Usage: vsysdescriptorId = proxy.CopyVSYSDescriptor(vsysDescriptorId, key)
CreateAddressPool(self, pipFrom=None, pipTo=None)
CreateEFM(self, vsysId, efmType, efmName, networkId, efmGrade=None)
Usage: efmId = proxy.CreateEFM(self, vsys.vsysId, 'SLB', 'My LoadBalancer', vsys.vnets[0])
CreateMultipleVServer(self, vsysId, vservers)
CreateSnapshot(self, vsysId, vdiskId, comment=None)
CreateVDisk(self, vsysId, vdiskName, size)
Usage: vdiskId = proxy.CreateVDisk(self, vsys.vsysId, vdiskName, size)
CreateVSYS(self, vsysDescriptorId, vsysName)
Usage: vsysId = proxy.CreateVSYS(vsysdescriptor.vsysdescriptorId, 'My New System')
CreateVServer(self, vsysId, vserverName, vserverType, diskImageId, networkId, multiNic=None)
Usage: vserverId = proxy.CreateVServer(self, vsys.vsysId, 'My New Server', servertype.name, diskimage.diskimageId, vsys.vnets[0])
DeleteAddressRange(self, pipFrom, pipTo)
DestroyEFM(self, vsysId, efmId)
DestroyEFMBackup(self, vsysId, efmId, backupId)
DestroySnapshot(self, vsysId, snapshotId)
DestroyVDisk(self, vsysId, vdiskId)
DestroyVDiskBackup(self, vsysId, backupId)
DestroyVSYS(self, vsysId)
DestroyVServer(self, vsysId, vserverId)
DetachPublicIP(self, vsysId, publicIp)
DetachVDisk(self, vsysId, vserverId, vdiskId)
ExternalRestoreVDisk(self, srcVsysId, srcBackupId, dstVsysId, dstVdiskId, key)
Usage: status = proxy.ExternalRestoreVDisk(srcVsysId, srcBackupId, dstVsysId, dstVdiskId, key)
FreePublicIP(self, vsysId, publicIp)
GetAddressRange(self)
Usage: addressranges = proxy.GetAddressRange()
GetDiskImageAttributes(self, diskImageId)
Usage: diskimage = proxy.GetDiskImageAttributes(diskimage.diskimageId)
GetDiskImageCopyKey(self, diskImageId, timeZone=None, countryCode=None)
Usage: result = proxy.GetDiskImageCopyKey(diskImageId)
GetEFMAttributes(self, vsysId, efmId)
Usage: efmattr = proxy.GetEFMAttributes(vsys.vsysId, loadbalancer.efmId)
GetEFMConfigHandler(self, vsysId, efmId)
Handler for specific GetEFMConfiguration methods, see FGCPGetEFMConfigHandler for details
Usage: fw_policies = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_policy(from_zone, to_zone)
GetEFMConfiguration(self, vsysId, efmId, configurationName, configurationXML=None, redundancyCategory=None)
Generic method for all GetEFMConfiguration methods
GetEFMPacketCaptureStatus(self, vsysId, efmId, redundancyCategory=None)
GetEFMStatus(self, vsysId, efmId, redundancyCategory=None)
Usage: status = proxy.GetEFMStatus(vsys.vsysId, loadbalancer.efmId)
GetEventLog(self, all=None, timeZone=None, countryCode=None)
Usage: logs = proxy.GetEventLog()
GetInformation(self, all=None, timeZone=None, countryCode=None)
Usage: infos = proxy.GetInformation()
GetPerformanceInformation(self, vsysId, vserverId=None, interval='10minute', dataType=None, efmId=None, redundancyCategory=None)
"
Usage: perfinfos = proxy.GetPerformanceInformation(vsys.vsysId, vserver.vserverId, interval='hour')
GetPublicIPAttributes(self, publicIp)
Usage: publicipattr = proxy.GetPublicIPAttributes(publicip.address)
GetPublicIPStatus(self, publicIp)
Usage: status = proxy.GetPublicIPStatus(publicip.address)
GetSystemUsage(self, vsysIds=None, storageNames=None, year=None, month=None)
NOTE: extra 'date' element on top-level compared to other API calls !
Usage: date, usage = proxy.GetSystemUsage()
GetUserInformation(self, userId)
Usage: info = proxy.GetUserInformation(user.id)
GetVDiskAttributes(self, vsysId, vdiskId)
Usage: vdiskattr = proxy.GetVDiskAttributes(vsys.vsysId, vdisk.vdiskId)
GetVDiskBackupCopyKey(self, vsysId, backupId, timeZone=None, countryCode=None)
Usage: result = proxy.GetVDiskBackupCopyKey(vsysId, backupId)
GetVDiskStatus(self, vsysId, vdiskId)
Usage: status = proxy.GetVDiskStatus(vsys.vsysId, vdisk.vdiskId)
GetVSYSAttributes(self, vsysId)
Usage: vsysattr = proxy.GetVSYSAttributes(vsys.vsysId)
GetVSYSConfiguration(self, vsysId)
Usage: vsysconfig = proxy.GetVSYSConfiguration(vsys.vsysId)
GetVSYSDescriptorAttributes(self, vsysDescriptorId)
Usage: vsysdescriptorattr = proxy.GetVSYSDescriptorAttributes(vsysdescriptor.vsysdescriptorId)
GetVSYSDescriptorConfiguration(self, vsysDescriptorId)
Usage: vsysdescriptorconfig = proxy.GetVSYSDescriptorConfiguration(vsysdescriptor.vsysdescriptorId)
GetVSYSDescriptorCopyKey(self, vsysDescriptorId, timeZone=None, countryCode=None)
Usage: result = proxy.GetVSYSDescriptorCopyKey(vsysDescriptorId)
GetVSYSStatus(self, vsysId)
Usage: status = proxy.GetVSYSStatus(vsys.vsysId)
GetVServerAttributes(self, vsysId, vserverId)
Usage: vserverattr = proxy.GetVServerAttributes(vsys.vsysId, vserver.vserverId)
GetVServerConfiguration(self, vsysId, vserverId)
Usage: vserverconfig = proxy.GetVServerConfiguration(vsys.vsysId, vserver.vserverId)
GetVServerInitialPassword(self, vsysId, vserverId)
Usage: initialpwd = proxy.GetVServerInitialPassword(vsys.vsysId, vserver.vserverId)
GetVServerStatus(self, vsysId, vserverId)
Usage: status = proxy.GetVServerStatus(vsys.vsysId, vserver.vserverId)
ListDiskImage(self, serverCategory=None, vsysDescriptorId=None)
Usage: diskimages = proxy.ListDiskImage()
ListEFM(self, vsysId, efmType)
Usage:
firewalls = proxy.ListEFM(vsys.vsysId, "FW")
loadbalancers = proxy.ListEFM(vsys.vsysId, "SLB")
ListEFMBackup(self, vsysId, efmId, timeZone=None, countryCode=None)
Usage: backups = proxy.ListEFMBackup(vsys.vsysId, firewall.efmId)
ListProductMaster(self, category=None)
Usage: result = proxy.ListProductMaster()
ListPublicIP(self, vsysId=None)
Usage: publicips = proxy.ListPublicIP()
ListServerType(self, diskImageId)
Usage: servertypes = proxy.ListServerType(diskimage.diskimageId)
ListSnapshot(self, vsysId, vdiskId, timeZone=None, countryCode=None)
Usage: snapshots = proxy.ListSnapshot(vsys.vsysId, vdisk.vdiskId)
ListUser(self)
Usage: users = proxy.ListUser()
ListUserAuthority(self)
Usage: users = proxy.ListUserAuthority()
ListVDisk(self, vsysId)
Usage: vdisks = proxy.ListVDisk(vsys.vsysId)
ListVDiskBackup(self, vsysId, vdiskId, timeZone=None, countryCode=None)
Usage: backups = proxy.ListVDiskBackup(vsys.vsysId, vdisk.vdiskId)
ListVSYS(self)
Usage: vsystems = proxy.ListVSYS()
ListVSYSDescriptor(self, keyword=None, estimateFrom=None, estimateTo=None)
"
Usage: vsysdescriptors = proxy.ListVSYSDescriptor()
ListVServer(self, vsysId)
Usage: vservers = proxy.ListVServer(vsys.vsysId)
RegisterPrivateDiskImage(self, vserverId, name, description)
RegisterPrivateVSYSDescriptor(self, vsysId, name, description, keyword, vservers)
Usage:
vsys = proxy.GetSystemInventory('My Existing VSYS')
proxy.RegisterPrivateVSYSDescriptor(vsys.vsysId, 'My New Template', 'This is a new template based on my existing VSYS', 'some key words', vsys.vservers)
RegisterUser(self, users)
Usage: usersinfo = proxy.RegisterUser(users)
RestoreEFM(self, vsysId, efmId, backupId)
RestoreSnapshot(self, vsysId, snapshotId)
RestoreVDisk(self, vsysId, backupId)
SetDiskImageCopyKey(self, diskImageId, contractNrs)
Usage: status = proxy.SetDiskImageCopyKey(diskImageId, contractNrs)
SetVDiskBackupCopyKey(self, vsysId, backupId, contractNrs=None)
Usage: status = proxy.SetVDiskBackupCopyKey(vsysId, backupId, contractNrs)
SetVSYSDescriptorCopyKey(self, vsysDescriptorId, contractNrs)
Usage: status = proxy.SetVSYSDescriptorCopyKey(vsysDescriptorId, contractNrs)
StandByConsole(self, vsysId, networkId)
Usage: url = proxy.StandByConsole(vsys.vsysId, vsys.vnets[0])
StartEFM(self, vsysId, efmId, redundancyCategory=None)
StartEFMPacketCapture(self, vsysId, efmId, redundancyCategory=None)
StartVServer(self, vsysId, vserverId)
StopEFM(self, vsysId, efmId, redundancyCategory=None)
StopEFMPacketCapture(self, vsysId, efmId, redundancyCategory=None)
StopVServer(self, vsysId, vserverId, force=None)
UnregisterDiskImage(self, diskImageId)
UnregisterPrivateVSYSDescriptor(self, vsysDescriptorId)
UnregisterUser(self, userIds)
Usage: usersinfo = proxy.UnregisterUser(userIds)
UnregisterVSYSDescriptor(self, vsysDescriptorId)
UpdateDiskImageAttribute(self, diskImageId, updateLcId, attributeName, attributeValue)
UpdateEFMAttribute(self, vsysId, efmId, attributeName, attributeValue)
UpdateEFMConfigHandler(self, vsysId, efmId)
Handler for specific UpdateEFMConfiguration methods, see FGCPUpdateEFMConfigHandler for details
Usage: proxy.UpdateEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_dns('AUTO')
UpdateEFMConfiguration(self, vsysId, efmId, configurationName, configurationXML=None, filePath=None, redundancyCategory=None)
Generic method for all UpdateEFMConfiguration methods
UpdateUserAttribute(self, users)
Usage: usersinfo = proxy.UpdateUserAttribute(users)
UpdateUserAuthority(self, users)
Usage: status = proxy.UpdateUserAuthority(users)
UpdateUserInformation(self, userId, userInfo)
Usage: usersinfo = proxy.UpdateUserInformation(userId, userInfo)
UpdateVDiskAttribute(self, vsysId, vdiskId, attributeName, attributeValue)
UpdateVSYSAttribute(self, vsysId, attributeName, attributeValue)
UpdateVSYSConfiguration(self, vsysId, configurationName, configurationValue)
UpdateVSYSDescriptorAttribute(self, vsysDescriptorId, updateLcId, attributeName, attributeValue)
UpdateVServerAttribute(self, vsysId, vserverId, attributeName, attributeValue)
set_verbose(self, verbose=None)
Show output (1), status checks (2) or nothing (0)
show_output(self, text='')
show_status(self, text='')

Methods inherited from fgcp.connection.FGCPConnection:
__init__(self, key_file='client.pem', region='de', verbose=0, debug=0, conn=None)
Use the same PEM file for SSL client certificate and RSA key signature
 
Note: to convert your .p12 or .pfx file to unencrypted PEM format, you can use
the following 'openssl' command:
 
openssl pkcs12 -in UserCert.p12 -out client.pem -nodes
__repr__(self)
add_param(self, key=None, value=None, depth=0)
close(self)
connect(self)
do_action(self, action, params=None, attachments=None)
Send the XML-RPC request and get the response
get_accesskeyid(self)
# see com.fujitsu.oviss.pub.OViSSSignature
get_body(self, action, params=None, attachments=None)
get_headers(self, attachments=None)
get_signature(self, acc=None)
# see com.fujitsu.oviss.pub.OViSSSignature
receive(self)
send(self, method, uri, body, headers)
set_conn(self, conn)
set_key(self, key_string)
set_region(self, region)

Data and other attributes inherited from fgcp.connection.FGCPConnection:
api_version = '2015-01-30'
debug = 0
key_file = 'client.pem'
locale = 'en'
region = 'de'
timezone = 'Central European Time'
uri = '/ovissapi/endpoint'
user_agent = 'OViSS-API-CLIENT'
verbose = 0

Methods inherited from future.types.newobject.newobject:
__long__(self)
__native__(self)
Hook for the future.utils.native() function
__nonzero__(self)
__unicode__(self)
next(self)

Data descriptors inherited from future.types.newobject.newobject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class FGCPCommandError(fgcp.FGCPError)
    
Method resolution order:
FGCPCommandError
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>
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__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class FGCPGenericEFMHandler(future.types.newobject.newobject)
    Generic Handler for FGCP Get/Update EFM Configuration methods
 
 
Method resolution order:
FGCPGenericEFMHandler
future.types.newobject.newobject
__builtin__.object

Methods defined here:
__init__(self, proxy, vsysId=None, efmId=None)

Data and other attributes defined here:
efmId = None
vsysId = None

Methods inherited from future.types.newobject.newobject:
__long__(self)
__native__(self)
Hook for the future.utils.native() function
__nonzero__(self)
__unicode__(self)
next(self)

Data descriptors inherited from future.types.newobject.newobject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class FGCPGetEFMConfigHandler(FGCPGenericEFMHandler)
    Handler for FGCP GetEFMConfiguration methods
 
Example: fw_nat_rules = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_nat_rule()
 
 
Method resolution order:
FGCPGetEFMConfigHandler
FGCPGenericEFMHandler
future.types.newobject.newobject
__builtin__.object

Methods defined here:
efm_update(self)
Common method for FW and SLB EFM_UPDATE returns firewall or loadbalancer
fw_dns(self)
Usage: fw_dns = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_dns()
fw_limit_policy(self, from_zone=None, to_zone=None)
CHECKME: for network identifiers besides INTERNET and INTRANET, see GetVSYSConfiguration()
Usage: fw_limit_policy = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_limit_policy(from_zone, to_zone)
fw_log(self, num=100, orders=None)
CHECKME: for network identifiers besides INTERNET and INTRANET, see GetVSYSConfiguration()
Usage:
ipaddress = vsys.publicips[0].address
orders = [FGCPFWLogOrder(prefix='dst', value=ipaddress, from_zone=None, to_zone=None)]
fw_log = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_log(100, orders)
fw_nat_rule(self)
Usage: fw_nat_rules = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_nat_rule()
fw_policy(self, from_zone=None, to_zone=None)
CHECKME: for network identifiers besides INTERNET and INTRANET, see GetVSYSConfiguration()
Usage: fw_policies = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_policy(from_zone, to_zone)
fw_update(self)
Usage: fw_update = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_update()
slb_cert_list(self, certCategory=None, detail=None)
Usage: slb_cert_list = proxy.GetEFMConfigHandler(vsys.vsysId, loadbalancer.efmId).slb_cert_list()
slb_error(self)
Usage: slb_error_stats = proxy.GetEFMConfigHandler(vsys.vsysId, loadbalancer.efmId).slb_error()
slb_load(self)
Usage: slb_load_stats = proxy.GetEFMConfigHandler(vsys.vsysId, loadbalancer.efmId).slb_load()
slb_rule(self)
Usage: slb_rule = proxy.GetEFMConfigHandler(vsys.vsysId, loadbalancer.efmId).slb_rule()
slb_try_getaction(self, action)
slb_update(self)
Usage: slb_update = proxy.GetEFMConfigHandler(vsys.vsysId, loadbalancer.efmId).slb_update()

Methods inherited from FGCPGenericEFMHandler:
__init__(self, proxy, vsysId=None, efmId=None)

Data and other attributes inherited from FGCPGenericEFMHandler:
efmId = None
vsysId = None

Methods inherited from future.types.newobject.newobject:
__long__(self)
__native__(self)
Hook for the future.utils.native() function
__nonzero__(self)
__unicode__(self)
next(self)

Data descriptors inherited from future.types.newobject.newobject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class FGCPUpdateEFMConfigHandler(FGCPGenericEFMHandler)
    Handler for FGCP UpdateEFMConfiguration methods
 
Example: proxy.UpdateEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_dns('AUTO')
 
 
Method resolution order:
FGCPUpdateEFMConfigHandler
FGCPGenericEFMHandler
future.types.newobject.newobject
__builtin__.object

Methods defined here:
efm_backout(self)
efm_update(self)
fw_dns(self, dnstype='AUTO', primary=None, secondary=None)
Usage: proxy.UpdateEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_dns('AUTO')
fw_nat_rule(self, rules=None)
Usage:
fw_nat_rules = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_nat_rule()
proxy.UpdateEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_nat_rule(fw_nat_rules)
fw_policy(self, log='On', directions=None)
Usage:
policies = proxy.GetEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_policy()
proxy.UpdateEFMConfigHandler(vsys.vsysId, firewall.efmId).fw_policy('On', policies)
 
Warning: this overrides the complete firewall configuration, so you need to specify all the policies at once !
slb_cca_add(self, ccacertNum, filePath)
Note: cca certificates in .crt or .pem format ARE supported here (and others ?)
slb_cca_delete(self, ccacertNum)
slb_cert_add(self, certNum, filePath, passphrase)
Note: server certificates in unencrypted PEM format are NOT supported here, use PKCS12 format (and others ?)
slb_cert_delete(self, certNum, force=None)
slb_cert_release(self, certNum)
slb_cert_set(self, certNum, id)
slb_error_clear(self)
slb_load_clear(self)
slb_rule(self, groups=None, force=None, webAccelerator=None)
Usage:
slb_rule = proxy.GetEFMConfigHandler(vsys.vsysId, loadbalancer.efmId).slb_rule()
proxy.UpdateEFMConfigHandler(vsys.vsysId, loadbalancer.efmId).slb_rule(slb_rule.groups)
 
Warning: this overrides the complete loadbalancer configuration, so you need to specify all the groups at once !
slb_start_maint(self, id, ipAddress, time=None, unit=None)
slb_stop_maint(self, id, ipAddress)
slb_try_updateaction(self, action)

Methods inherited from FGCPGenericEFMHandler:
__init__(self, proxy, vsysId=None, efmId=None)

Data and other attributes inherited from FGCPGenericEFMHandler:
efmId = None
vsysId = None

Methods inherited from future.types.newobject.newobject:
__long__(self)
__native__(self)
Hook for the future.utils.native() function
__nonzero__(self)
__unicode__(self)
next(self)

Data descriptors inherited from future.types.newobject.newobject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)