nuagenetworks / vspk-python

A Python library for managing Nuage through its API
http://www.nuagenetworks.net
BSD 3-Clause "New" or "Revised" License
17 stars 19 forks source link

Parameter checks when creating NSGateways #24

Closed techraving closed 6 years ago

techraving commented 6 years ago

I'm actually using vspk-ansible to create the NSGateway and am getting the below error message: "msg": "Unable to create entity: [HTTP 409(Conflict)] [{u'property': u'', u'descriptions': [{u'description': u'VNS Gateway nsg_test_2 personality must be now set', u'title': u'VNS Gateway personality error'}]}]"

The call:

When doing a regular curl to this method the result is the NSGateway is creates the NSG without requiring a personality. If I add a personality in the properties of the task it then complains that a templateID is then required.

I've tried this in both vspk-python 4.0 & 5.1 to the same affect. Is there something else that should be done?

pdellaert commented 6 years ago

@techraving, in the properties section, you need to use template_id, as this is the Python VSPK variable that holds the actual template ID.

So you're code would be:

- name: Create an NSG instance
  connection: local
  nuage_vspk:
    auth: "{{ nuage_auth }}"
    type: NSGateway
    parent_id: "{{ nuage_enterprise.id }}"
    parent_type: Enterprise
    state: present
    properties:
      name: "{{ nsg_name }}"
      template_id: "{{ nuage_template_id }}"
      personality: "NSG"
      description: "Created by Ansible"
  register: response
techraving commented 6 years ago

Thank you sir!