CiscoDevNet / virl2-client

Client library for the Cisco VIRL 2 Network Simulation Platform
Apache License 2.0
56 stars 18 forks source link

Fix url in create_image_definition #17

Closed tzarski0 closed 3 years ago

tzarski0 commented 3 years ago

Fixes #16

rschmied commented 3 years ago

hi, @tzarski0 thanks for your contribution... I was wondering if you could live with:

body = {
    "id": image_id,
    "node_definition_id": node_definition_id,
    "label": label,
    "disk_image": disk_image,
}
upload_image_definition(body, json=True)

as the create_image_definition function was removed for (unreleased) 2.3. Do you have any strong opinions on retaining / removing the function?

rschmied commented 3 years ago

I apparently was ahead of time... the code snippet i've posted is for the 2.3 code. with 2.2 client library, you'd need to do:

image_def = {
    "id": image_id,
    "node_definition_id": node_definition_id,
    "label": label,
    "disk_image": disk_image,
}
upload_image_definition(body=json.dumps(image_def))
tzarski0 commented 3 years ago

Thanks @rschmied. If create_image_definition will be removed soon, then I'm OK to use upload_image_definition.