Skip to content

Using API Correctly? #32

@robertf57

Description

@robertf57

I'm trying to use your Linode Python API but I'm getting an error I don't understand. Can you help me? I want to get a list of the disks attached to a particular linode using this code:

from linode import api as linode_api
api = linode_api.Api(<my_api_key>)
linode_id = 1800300
disks = api.linode_disk_list(linode_id)

When I execute the code, I get the following error:

TypeError: wrapper() takes exactly 1 argument (2 given)

I know I'm creating the api instance correctly as I'm using it to successfully call the API's linode_ip_list method. Interestingly, if I don't provide the linode_id argument, I get this error:

linode.api.MissingRequiredArgument: 'LinodeID'

If I call the method with a linode ID, the error says I'm giving it two arguments. But if I don't give it any arguments, it says I'm missing an argument. At this point, I'm not sure if the LinodeID should be an integer or a string but I get the same error in either case. How do I call this method so that I don't get the TypeError argument? Thank you for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions