コード例 #1
0
from util import generate_signature, get_seconds_since_epoch, generate_guid, \
    encode_signature


#make a request

#get encoded signature

signature = generate_signature(get_seconds_since_epoch(), 
                                       generate_guid())

encoded_signature = "YTczMmQ4ZjUyZTMxYWMxNGI4MTljNjg2MTE4MmExMzc2MTJkNzBlZDg4NmRmNTI5MDkxYWU1NjNhNDk0MDRjMA==" #encode_signature(signature)

print encoded_signature



コード例 #2
0
        url_data['InstanceId_%s' % (index+1)] = value
        
    return read_api_url(API_METHOD_URLS['terminate-instance'], url_data)
#-------------------------------------------------------------------------------
if __name__=="__main__":
#    print describe_available_plan('XXS', 'linux', '2010-12-30', 
#                              'ATL64cdb70e4d3723a02dc401e87d3d119e', 
#                              '219579ec450e5aa7bb63d1f659c380916177cf9d',
#                              'xml', get_seconds_since_epoch(), 
#                               generate_rndguid())
#    
    
    
#    print describe_image('2010-12-30', 'ATL64cdb70e4d3723a02dc401e87d3d119e',
#                         '219579ec450e5aa7bb63d1f659c380916177cf9d', 'json',
#                         get_seconds_since_epoch(),generate_rndguid(),
#                         imageid="ubuntu-12.04_32bit" )


#    print list_instances('2010-12-30', 'ATL64cdb70e4d3723a02dc401e87d3d119e',
#                         '219579ec450e5aa7bb63d1f659c380916177cf9d', 'json',
#                         get_seconds_since_epoch(),generate_rndguid(),
#                          )

    print describe_instance('2010-12-30', 'ATL64cdb70e4d3723a02dc401e87d3d119e',
                         '219579ec450e5aa7bb63d1f659c380916177cf9d', 'json',
                         get_seconds_since_epoch(),generate_rndguid(),
                          20950)