示例#1
0
        return self.resource

    def get_action(self):
        return self.action

    def get_command_construct(self):
        result = [self.api, self.resource, self.action]
        return result
    '''
    def create_command(self, base=None):
        fields = {}

        fields['take_action'] = self.take_action()
        fields['get_parser'] = self.get_parser()

        model = type(self.name, base, fields)

        return model
    '''

if __name__ == '__main__':
    cls = get_driver(Provider.EC2_US_WEST)
    driver = DriverMethod(cls, 'create_node')
    app_args = driver.get_description()
    app_args['api'] = 'compute'
    resource, action = get_resource_action('create_node')
    app_args['resource'] = resource
    app_args['action'] = action
    D = DynamicClass(app_args)
    print D.get_command_construct()
示例#2
0
def methodInfo(driver, method):
    D = DriverMethod(driver, method)
    result = D.get_description()
    return result