Changes between Version 15 and Version 16 of SeattleGeniClientLib

Changes between Version 15 and Version 16 of SeattleGeniClientLib

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 15 and Version 16 of SeattleGeniClientLib

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 15 and Version 16 of SeattleGeniClientLib

Show
Ignore:
Timestamp:
07/05/12 20:42:51 (7 years ago)
Author:
leonwlaw
Comment:

Quick pass of GENI->Clearinghouse. Left link/file references intact.

Legend:

Unmodified
Added
Removed
Modified
  • SeattleGeniClientLib

    v15 v16  
    1         = SeattleClearinghouse XML-RPC Client Library = 
     1        = Seattle Clearinghouse XML-RPC Client Library = 
    22[[BR]] 
    3 The SeattleClearinghouse XML-RPC Client Library is a Python XMLRPC client for communicating with the SeattleClearinghouse XML-RPC Interface. 
     3The Seattle Clearinghouse XML-RPC Client Library is a Python XMLRPC client for communicating with the Seattle Clearinghouse XML-RPC Interface. 
    44 
    5 You can download the the client from here: [source:seattle/trunk/seattlegeni/xmlrpc_clients/seattleclearinghouse_xmlrpc.py SeattleClearinghouse Python XMLRPC Client]. Look for the link to "original format" at the bottom of that page to download the file. 
     5You can download the the client from here: [source:seattle/trunk/seattlegeni/xmlrpc_clients/seattleclearinghouse_xmlrpc.py Seattle Clearinghouse Python XMLRPC Client]. Look for the link to "original format" at the bottom of that page to download the file. 
    66 
    77[[BR]] 
     
    99  1. Download the client code linked to above (it is a Python module). 
    1010  1. In your Python script, import seattleclearinghouse_xmlrpc.[[BR]] 
    11   1. Create an instance (or multiple instances, if desired) of the class seattleclearinghouse_xmlrpc.SeattleClearinghouseClient.[[BR]] 
     11  1. Create an instance (or multiple instances, if desired) of the class seattleclearinghouse_xmlrpc.!SeattleClearinghouseClient.[[BR]] 
    1212     The following parameters can be passed to the constructor: 
    1313     * ''username'': Your username. (Required) 
    1414     * ''private_key_string'': Your private key. (Either this or the api_key is required) 
    1515     * ''api_key'': Your api_key. 
    16      * ''xmlrpc_url'': The url where the SeattleClearinghouse XMLRPC server is located. (Defaults is our main SeattleClearinghouse testbed's xmlrpc url.) 
     16     * ''xmlrpc_url'': The url where the Seattle Clearinghouse XMLRPC server is located. (Defaults is our main Seattle Clearinghouse testbed's xmlrpc url.) 
    1717     * ''allow_ssl_insecure'': True/False, if set to True, allows SSL to operate in an INSECURE manner. '''Do not use allow_ssl_insecure=True in production code.''' (Default is False) 
    1818     * ''ca_certs_file'': The location of a file containing your trusted CA certificates. (Default is a file named `cacert.pem` in the same directory that you place `seattleclearinghouse_xmlrpc.py` in.) 
     
    2121[[BR]] 
    2222=== Using Secure SSL === 
    23 In order to perform secure SSL communication with SeattleClearinghouse: 
     23In order to perform secure SSL communication with Seattle Clearinghouse: 
    2424  * You must have M2Crypto installed. 
    2525  * You must set the value of CA_CERTIFICATES_FILE to the location of a PEM 
     
    3131XMLRPC servers that use https but you will be vulnerable to a man-in-the-middle 
    3232attack. To enable this insecure mode, include the argument `allow_ssl_insecure=True` 
    33 when creating a SeattleClearinghouseClient instance. 
     33when creating a !SeattleClearinghouseClient instance. 
    3434 
    3535[[BR]] 
    36 === SeattleClearinghouseClient Methods === 
     36=== !SeattleClearinghouseClient Methods === 
    3737Please note, these methods are not the same as the XML-RPC API calls. 
    3838The clientlib methods are simply convenient wrappers for those calls.  
    39 As such, most methods here have identical return values as the actual XMLRPC calls. Refer to the [wiki:SeattleGeniApi SeattleClearinghouse XMLRPC API spec] for more info about what these functions return. 
     39As such, most methods here have identical return values as the actual XMLRPC calls. Refer to the [wiki:SeattleGeniApi Seattle Clearinghouse XMLRPC API spec] for more info about what these functions return. 
    4040 
    41 Available methods on SeattleClearinghouseClient objects: 
    42   The acquire methods all return a list of acquired resources, following the SeattleClearinghouse XMLRPC API spec. 
     41Available methods on !SeattleClearinghouseClient objects: 
     42  The acquire methods all return a list of acquired resources, following the Seattle Clearinghouse XMLRPC API spec. 
    4343  * ''acquire_lan_resources(num)'':  Acquires ''num'' LAN vessels. 
    4444  * ''acquire_wan_resources(num)'':  Acquires ''num'' WAN vessels. 
     
    5757 
    5858=== Exceptions === 
    59 The following exceptions can be raised by SeattleClearinghouseClient methods:[[BR]] 
    60   * SeattleClearinghouseError -- Base class for all exceptions raised by the SeattleClearinghouseClient. 
     59The following exceptions can be raised by !SeattleClearinghouseClient methods:[[BR]] 
     60  * !SeattleClearinghouseError -- Base class for all exceptions raised by the !SeattleClearinghouseClient. 
    6161  * !CommunicationError -- Indicates that XMLRPC communication failed. 
    6262  * !InternalError -- Indicates an unexpected error occurred, probably either a bug in this 
    63     client or a bug in SeattleClearinghouse. 
     63    client or a bug in Seattle Clearinghouse. 
    6464  * !AuthenticationError -- Indicates an authentication failure (invalid username and/or API key). 
    6565  * !InvalidRequestError -- Indicates that the request is invalid. 
    6666  * !NotEnoughCreditsError -- Indicates that the requested operation requires more vessel credits to 
    6767    be available then the account currently has. 
    68   * !UnableToAcquireResourcesError -- Indicates that the requested operation failed because SeattleClearinghouse was unable 
     68  * !UnableToAcquireResourcesError -- Indicates that the requested operation failed because Seattle Clearinghouse was unable 
    6969    to acquire the requested resources. 
    7070 
     
    7373[[BR]] 
    7474=== Example === 
    75 Here is an example of how to use the SeattleClearinghouse XML-RPC Client. This could be a python script which you run.[[BR]] 
     75Here is an example of how to use the Seattle Clearinghouse XML-RPC Client. This could be a python script which you run.[[BR]] 
    7676{{{ 
    7777#!python 
     
    9191 
    9292# Only one of either the API key or the private key is needed. If providing 
    93 # your API key, be sure to pass the API key to the SeattleClearinghouseClient 
     93# your API key, be sure to pass the API key to the !SeattleClearinghouseClient 
    9494# constructor below. 
    9595#API_KEY = "your_api_key" 
     
    129129    return 
    130130  except seattleclearinghouse_xmlrpc.UnableToAcquireResourcesError, err: 
    131     print("Couldn't acquire vessels because SeattleClearinghouse doesn't have enough " + 
     131    print("Couldn't acquire vessels because Seattle Clearinghouse doesn't have enough " + 
    132132          "of what we asked for: " + str(err)) 
    133133    return 
     
    165165  try: 
    166166    do_example_acquire_renew_release() 
    167   except seattleclearinghouse_xmlrpc.SeattleClearinghouseError: 
     167  except seattleclearinghouse_xmlrpc.Seattle ClearinghouseError: 
    168168    # In a real script, you'd want to handle this. Could be an authentication 
    169169    # error, communication error, etc. You can use the fine-grained exceptions 
    170     # rather than the base exception of SeattleClearinghouseError to do different 
     170    # rather than the base exception of Seattle ClearinghouseError to do different 
    171171    # things based on what the actual problem was. 
    172172    raise