API Commands for the Fujitsu Global Cloud Platform (FGCP)

The following list gives an overview of all low-level API Commands supported by the XML-RPC API version 2011-01-31 of the Fujitsu Global Cloud Platform that can be used by your scripts. They are grouped by logical "resource type" for presentation purposes only.

Reference: Fujitsu Cloud API Design

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)
    ...

http://mikespub.net/fgcp_command_yuml.png

Note: this client API library also provides higher-level Client Methods and intermediate Resource Actions.


Virtual Data Center (VDC)

from fgcp.command import FGCPCommand
proxy = FGCPCommand(key_file='client.pem', region='de')

date, usage = proxy.GetSystemUsage()

vsystems = proxy.ListVSYS()
for vsys in vsystems:
    test_vsys(proxy, vsys.vsysId)
    break

publicips = proxy.ListPublicIP(None)
for publicip in publicips:
    test_publicip(proxy, publicip.address)
    break

test_addressrange(proxy)

vsysdescriptors = proxy.ListVSYSDescriptor()
for vsysdescriptor in vsysdescriptors:
    test_vsysdescriptor(proxy, vsysdescriptor.vsysdescriptorId)
    break

diskimages = proxy.ListDiskImage()
for diskimage in diskimages:
    test_diskimage(proxy, diskimage.diskimageId)
    break

Virtual System (VSYS)

vsys_attr = proxy.GetVSYSAttributes(vsysId)
vsysName = vsys_attr.vsysName
result = proxy.UpdateVSYSAttribute(vsysId, 'vsysName', vsysName)
try:
    cloudCategory = vsys_attr.cloudCategory
    #result = proxy.UpdateVSYSConfiguration(vsysId, 'CLOUD_CATEGORY', cloudCategory)
except:
    pass

status = proxy.GetVSYSStatus(vsysId)

vservers = proxy.ListVServer(vsysId)
for vserver in vservers:
    test_vsys_vserver(proxy, vsysId, vserver.vserverId)
    break

#result = proxy.CreateVDisk(vsysId, vdiskName, size)
vdisks = proxy.ListVDisk(vsysId)
for vdisk in vdisks:
    test_vsys_vdisk(proxy, vsysId, vdisk.vdiskId)
    break

#result = proxy.AllocatePublicIP(vsysId)
publicips = proxy.ListPublicIP(vsysId)
for publicip in publicips:
    test_vsys_publicip(proxy, vsysId, publicip.address)
    break

vsys_config = proxy.GetVSYSConfiguration(vsysId)
for networkId in vsys_config.vnets:
    test_vsys_vnet(proxy, vsysId, networkId)
    break

efmType = 'FW'
#result = proxy.CreateEFM(vsysId, efmType, efmName, networkId)
firewalls = proxy.ListEFM(vsysId, efmType)
for firewall in firewalls:
    test_vsys_efm_generic(proxy, vsysId, firewall.efmId)
    test_vsys_efm_firewall(proxy, vsysId, firewall.efmId)
    break

efmType = 'SLB'
#result = proxy.CreateEFM(vsysId, efmType, efmName, networkId)
loadbalancers = proxy.ListEFM(vsysId, efmType)
for loadbalancer in loadbalancers:
    test_vsys_efm_generic(proxy, vsysId, loadbalancer.efmId)
    test_vsys_efm_loadbalancer(proxy, vsysId, loadbalancer.efmId)
    break

#result = proxy.CreateVServer(vsysId, vserverName, vserverType, diskImageId, networkId)

# only allowed on private vsysdescriptors
name = 'My New VSYS Template'
description = 'This is a 3-tier web application database template'
keyword = '3-tier web application database'
vservers = proxy.ListVServer(vsysId)
#result = proxy.RegisterPrivateVSYSDescriptor(vsysId, name, description, keyword, vservers)

#result = proxy.DestroyVSYS(vsysId)

Virtual Server (VServer)

#result = proxy.StartVServer(vsysId, vserverId)
#result = proxy.StopVServer(vsysId, vserverId, force=None)

vserver_attr = proxy.GetVServerAttributes(vsysId, vserverId)
vserverName = vserver_attr.vserverName
result = proxy.UpdateVServerAttribute(vsysId, vserverId, 'vserverName', vserverName)
try:
    vserverType = vserver_attr.vserverType
    result = proxy.UpdateVServerAttribute(vsysId, vserverId, 'vserverType', vserverType)
except:
    pass

status = proxy.GetVServerStatus(vsysId, vserverId)
password = proxy.GetVServerInitialPassword(vsysId, vserverId)

vserver_config = proxy.GetVServerConfiguration(vsysId, vserverId)

for vdisk in vserver_config.vdisks:
    test_vsys_vserver_vdisk(proxy, vsysId, vserverId, vdisk.vdiskId)
    break

for vnic in vserver_config.vnics:
    test_vsys_vserver_vnic(proxy, vsysId, vserverId, vnic.networkId)
    break

#result = proxy.RegisterPrivateDiskImage(vserverId, name, description)

#result = proxy.DestroyVServer(vsysId, vserverId)

Virtual Disk (VDisk)

#result = proxy.AttachVDisk(vsysId, vserverId, vdiskId)
#result = proxy.DetachVDisk(vsysId, vserverId, vdiskId)
#test_vsys_vdisk(vsysId, vdiskId)
proxy.GetVDiskAttributes(vsysId, vdiskId)
#result = proxy.UpdateVDiskAttribute(vsysId, vdiskId, 'vdiskName', vdisk.vdiskName)
proxy.GetVDiskStatus(vsysId, vdiskId)

#result = proxy.BackupVDisk(vsysId, vdiskId)
backups = proxy.ListVDiskBackup(vsysId, vdiskId)
for backup in backups:
    test_vsys_backup(proxy, vsysId, backup.backupId)
    break

#result = proxy.DestroyVDisk(vsysId, vdiskId)

Virtual Disk Backup

#result = proxy.RestoreVDisk(vsysId, backupId)
#result = proxy.DestroyVDiskBackup(vsysId, backupId)

Virtual Network Interface (VNIC)


Extended Function Module (EFM)

http://mikespub.net/fgcp_efmconfig_yuml.png

#result = proxy.StartEFM(vsysId, efmId)
#result = proxy.StopEFM(vsysId, efmId)

efm_attr = proxy.GetEFMAttributes(vsysId, efmId)
efmName = efm_attr.efmName
result = proxy.UpdateEFMAttribute(vsysId, efmId, 'efmName', efmName)
get_handler = proxy.GetEFMConfigHandler(vsysId, efmId)
#config = proxy.GetEFMConfiguration(vsysId, efmId, configurationName, configurationXML=None)
update_handler = proxy.UpdateEFMConfigHandler(vsysId, efmId)
#result = proxy.UpdateEFMConfiguration(vsysId, efmId, configurationName, configurationXML=None, filePath=None)
status = proxy.GetEFMStatus(vsysId, efmId)
update_info = proxy.GetEFMConfigHandler(vsysId, efmId).efm_update()
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).efm_update()
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).efm_backout()

#result = proxy.BackupEFM(vsysId, efmId)
backups = proxy.ListEFMBackup(vsysId, efmId, timeZone=None, countryCode=None)
for backup in backups:
    test_vsys_efm_backup(proxy, vsysId, efmId, backup.backupId)
    break

#result = proxy.DestroyEFM(vsysId, efmId)
#result = proxy.RestoreEFM(vsysId, efmId, backupId)
#result = proxy.DestroyEFMBackup(vsysId, efmId, backupId)

EFM Firewall (FW)

nat_rules = proxy.GetEFMConfigHandler(vsysId, efmId).fw_nat_rule()
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).fw_nat_rule(rules=nat_rules)
dns = proxy.GetEFMConfigHandler(vsysId, efmId).fw_dns()
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).fw_dns(dnstype='AUTO', primary=None, secondary=None)
policies = proxy.GetEFMConfigHandler(vsysId, efmId).fw_policy(from_zone=None, to_zone=None)
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).fw_policy(log='On', directions=policies)
logs = proxy.GetEFMConfigHandler(vsysId, efmId).fw_log(num=10, orders=None)
limit_policies = proxy.GetEFMConfigHandler(vsysId, efmId).fw_limit_policy(from_zone=None, to_zone=None)
update_info = proxy.GetEFMConfigHandler(vsysId, efmId).fw_update()

EFM LoadBalancer (SLB)

rules = proxy.GetEFMConfigHandler(vsysId, efmId).slb_rule()
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_rule(groups=rules.groups, force=None, webAccelerator=None)
load_stats = proxy.GetEFMConfigHandler(vsysId, efmId).slb_load()
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_load_clear()
error_stats = proxy.GetEFMConfigHandler(vsysId, efmId).slb_error()
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_error_clear()
cert_list = proxy.GetEFMConfigHandler(vsysId, efmId).slb_cert_list(certCategory=None, detail=None)
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_cert_add(certNum, filePath, passphrase)
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_cert_set(certNum, id)
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_cert_release(certNum)
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_cert_delete(certNum, force=None)
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_cca_add(ccacertNum, filePath)
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_cca_delete(ccacertNum)
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_start_maint(id, ipAddress, time=None, unit=None)
#result = proxy.UpdateEFMConfigHandler(vsysId, efmId).slb_stop_maint(id, ipAddress)
update_info = proxy.GetEFMConfigHandler(vsysId, efmId).slb_update()

Virtual Network (VNet)


Public IP (PublicIP)

publicip_attr = proxy.GetPublicIPAttributes(publicipAddress)
status = proxy.GetPublicIPStatus(publicipAddress)
#result = proxy.AttachPublicIP(vsysId, publicipAddress)
#result = proxy.DetachPublicIP(vsysId, publicipAddress)
#result = proxy.FreePublicIP(vsysId, publicipAddress)
#test_publicip(publicipAddress)

Address Range (AddressRange)

addressranges = proxy.GetAddressRange()
#result = proxy.CreateAddressPool(pipFrom=None, pipTo=None)
#result = proxy.AddAddressRange(pipFrom, pipTo)
#result = proxy.DeleteAddressRange(pipFrom, pipTo)

Virtual System Descriptor (VSYSDescriptor)

vsysdescriptor_attr = proxy.GetVSYSDescriptorAttributes(vsysdescriptorId)
# only allowed on private vsysdescriptors
vsysdescriptorName = vsysdescriptor_attr.vsysdescriptorName
description = vsysdescriptor_attr.description
keyword = vsysdescriptor_attr.keyword
#result = proxy.UpdateVSYSDescriptorAttribute(vsysdescriptorId, 'en', 'updateName', vsysdescriptorName)
#result = proxy.UpdateVSYSDescriptorAttribute(vsysdescriptorId, 'en', 'updateDescription', description)
#result = proxy.UpdateVSYSDescriptorAttribute(vsysdescriptorId, 'en', 'updateKeyword', keyword)
vsysdescriptor_config = proxy.GetVSYSDescriptorConfiguration(vsysdescriptorId)

#result = proxy.CreateVSYS(vsysdescriptorId, vsysdescriptorName)

diskimages = proxy.ListDiskImage('GENERAL', vsysdescriptorId)
#for diskimage in diskimages:
#    test_diskimage(proxy, diskimage.diskimageId)

#result = proxy.UnregisterPrivateVSYSDescriptor(vsysdescriptorId)
#result = proxy.UnregisterVSYSDescriptor(vsysdescriptorId)

Disk Image (DiskImage)

diskimage_attr = proxy.GetDiskImageAttributes(diskimageId)
# only allowed on private diskimages
diskimageName = diskimage_attr.diskimageName
#result = proxy.UpdateDiskImageAttribute(diskimageId, 'en', 'updateName', diskimageName)
description = diskimage_attr.description
#result = proxy.UpdateDiskImageAttribute(diskimageId, 'en', 'updateDescription', description)
#result = proxy.UnregisterDiskImage(diskimageId)

servertypes = proxy.ListServerType(diskimageId)
for servertype in servertypes:
    test_diskimage_servertype(proxy, diskimageId, servertype.name)
    break

Server Type (ServerType)


Other (SSL-VPN)

console_url = proxy.StandByConsole(vsysId, networkId)

Note: this client API library also provides higher-level Client Methods and intermediate Resource Actions.

Content: index  ClientMethods.html  ResourceActions.html  APICommands.html  ClassDiagrams.html  TestServer.html  RelayServer.html  pydoc fgcp  pydoc tests