Client Methods for the Fujitsu Global Cloud Platform (FGCP)

The following list gives an overview of higher-level methods supported by this client API library that can be used in your scripts. This list is likely to be extended in future releases, and any suggestions are welcome in the issue tracker.

Example: [see tests/test_client.py for more examples]

# Connect with your client certificate to region 'uk'
from fgcp.client import FGCPClient
client = FGCPClient('client.pem', 'uk')

# Call custom client methods
client.ShowSystemStatus()

The client methods below are organized in classes by client role, i.e. Client, Designer, Operator and Monitor. With version 1.0.x and later of the library, most of these client methods can now directly be replaced by corresponding Resource Actions.

http://mikespub.net/fgcp_client_yuml.png

Note: this client API library also provides lower-level API Commands and intermediate Resource Actions.


FGCPMonitor

client = FGCPMonitor(key_file='client.pem', region='de', verbose=0, debug=0)

Connect as Monitor with your client certificate to region 'de'

    vdc = FGCPVDataCenter(key_file='client.pem', region='de', verbose=0, debug=0)

client.FindSystemByName(vsysName)

Find VSystem by vsysName

    vsystem = vdc.get_vsystem(vsysName)

client.GetSystemInventory(vsysName=None)

Get VSystem inventory (by vsysName)

    vsystems = vdc.list_vsystems()
    inventory = vsystem.get_inventory()

client.GetSystemStatus(vsysName=None, verbose=None)

Get the overall system status (for a particular VSystem)

    status = vsystem.get_status()

client.ShowSystemStatus(vsysName=None, sep='\t')

Show the overall system status (for a particular VSystem)

    vdc.show_vsystem_status()
    vsystem.show_status()

+ all of the API Commands


FGCPOperator

client = FGCPOperator(key_file='client.pem', region='de', verbose=0, debug=0)

Connect as Operator with your client certificate to region 'de'

    vdc = FGCPVDataCenter(key_file='client.pem', region='de', verbose=0, debug=0)

client.StartVServerAndWait(vsysId, vserverId)

Start VServer and wait until it's running

    result = vserver.start(wait=True)

client.StopVServerAndWait(vsysId, vserverId, force=None)

Stop VServer and wait until it's stopped

    result = vserver.stop(wait=True, force=None)

client.BackupVDiskAndWait(vsysId, vdiskId)

Take Backup of VDisk and wait until it's finished (this might take a while)

    result = vdisk.backup(wait=True)

client.BackupVServerAndRestart(vsysId, vserverId)

Backup all VDisks of a VServer and restart the VServer (this might take a while)

    result = vserver.backup(wait=True)
    for vdisk in vserver.list_vdisks():
        result = vdisk.backup(wait=True)
    result = vserver.start(wait=True)

client.CleanupBackups(vsysId, vdiskId=None)

Clean up old VDisk backups e.g. to minimize disk space

    result = vdisk.cleanup_backups(max_num=100, max_age=None)

client.StartEFMAndWait(vsysId, efmId)

Start EFM and wait until it's running

    result = loadbalancer.start(wait=True)

client.StopEFMAndWait(vsysId, efmId)

Stop EFM and wait until it's stopped

    result = loadbalancer.stop(wait=True)

client.AttachPublicIPAndWait(vsysId, publicIp)

Attach PublicIP and wait until it's attached

    result = publicip.attach(wait=True)

client.DetachPublicIPAndWait(vsysId, publicIp)

Detach PublicIP and wait until it's detached

    result = publicip.detach(wait=True)

client.StartSystem(vsysName, verbose=None)

Start VSystem and wait until all VServers and EFMs are started (TODO: define start sequence for vservers)

    vsystem.boot(wait=True)
    vsystem.start(wait=True)

client.StopSystem(vsysName, verbose=None)

Stop VSystem and wait until all VServers and EFMs are stopped (TODO: define stop sequence for vservers)

    vsystem.stop(wait=True)
    vsystem.shutdown(wait=True)

+ all of the FGCPMonitor() Methods

+ all of the API Commands


FGCPDesigner

client = FGCPDesigner(key_file='client.pem', region='de', verbose=0, debug=0)

Connect as Designer with your client certificate to region 'de'

    vdc = FGCPVDataCenter(key_file='client.pem', region='de', verbose=0, debug=0)

client.FindDiskImageByName(diskimageName)

Find DiskImage by diskimageName

    diskimage = vdc.get_diskimage(diskimageName)

client.FindServerTypeByName(name)

Find ServerType by name

    servertype = vdc.get_servertype(name)

client.FindVSYSDescriptorByName(vsysdescriptorName)

Find VSYSDescriptor by vsysdescriptorName

    vsysdescriptor = vdc.get_vsysdescriptor(vsysdescriptorName)

client.CreateSystem(vsysName, vsysdescriptorName, verbose=None)

Create VSystem based on descriptor and wait until it's deployed

    vsysId = vdc.create_vsystem(vsysName, vsysdescriptorName, wait=True)

client.DestroySystem(vsysName, verbose=None)

Destroy VSystem after stopping all VServers and EFMs

    vdc.destroy_vsystem(vsysName, wait=True)

client.LoadSystemDesign(filePath, verbose=None)

Load VSystem design from file, for use e.g. in ConfigureSystem()

    design = vdc.get_vsystem_design()
    design.load_file(filePath)
    #design.build_vsystem(vsysName)

client.ConfigureSystem(vsysName, systemDesign, verbose=None)

Configure VSystem based on some systemDesign - see LoadSystemDesign()

    #design = vdc.get_vsystem_design()
    #design.load_file(filePath)
    design.build_vsystem(vsysName)

client.SaveSystemDesign(vsysName, filePath, verbose=None)

Save (fixed parts of) VSystem design to file

    design = vdc.get_vsystem_design()
    design.load_vsystem(vsysName)
    design.save_file(filePath)

+ all of the FGCPOperator() Methods

+ all of the API Commands


FGCPClient

client = FGCPClient(key_file='client.pem', region='de', verbose=0, debug=0)

Connect as generic Client with your client certificate to region 'de'

    vdc = FGCPVDataCenter(key_file='client.pem', region='de', verbose=0, debug=0)

+ all of the FGCPDesigner() Methods

+ all of the API Commands

Note: this client API library also provides lower-level API Commands and intermediate Resource Actions.

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