Public Cloud OVHcloud - API /cloud/project/{serviceName}/instance/{instanceId}/interface
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

API /cloud/project/{serviceName}/instance/{instanceId}/interface

Von
JulienC24
Erstellungsdatum 2019-04-03 17:01:41 (edited on 2024-09-04 11:20:33) in Public Cloud OVHcloud

Bonjour,

J'utilise cette API (parmis d'autre) via un playbook Ansible afin de créer un environnement de Recette à la volée. L'abstraction qu'elle fournit m'est donc très utile et m'évite de descendre au niveau d'OpenStack... Cependant depuis plusieurs semaine, il n'est plus possible de spécifier une IP:
```python
ovh_client.post('/cloud/project/{serviceName}/instance/{instanceId}/interface'.format(serviceName='*************', instanceId='*************'), networkId='***********', ip='192.168.54.71')
Traceback (most recent call last):
File "", line 1, in
File "/var/dashboard/venv/lib/python3.4/site-packages/ovh/client.py", line 377, in post
return self.call('POST', _target, kwargs, _need_auth)
File "/var/dashboard/venv/lib/python3.4/site-packages/ovh/client.py", line 446, in call
response=result)
ovh.exceptions.BadParametersError: Invalid input for field/attribute 0. Value: {u'subnet_id': u'', u'ip_address': u'192.168.54.71'}. Additional properties are not allowed (u'subnet_id' was unexpected)
```

Si je ne spécifie pas d'IP, ca fonctionne :
```python
ovh_client.post('/cloud/project/{serviceName}/instance/{instanceId}/interface'.format(serviceName='***********************, instanceId='******************'), networkId='**************')
{'macAddress': 'fa:16:3e:c0:72:88', 'state': 'DOWN', 'fixedIps': [{'subnetId': *********************', 'ip': '192.168.54.79'}], 'id': '43e652e2-9dec-40fe-9b28-588d8eea4f9f', 'type': 'private', 'networkId': '***********'}
```
Pourtant mon sous-reseau semble correctement configuré :
```python
ovh_client.get('/cloud/project/{serviceName}/network/private/{networkId}/subnet'.format(serviceName='**************************', networkId='***********'))
[{'ipPools': [{'network': '192.168.54.0/24', 'dhcp': False, 'region': 'SBG3', 'start': '192.168.54.50', 'end': '192.168.54.90'}], 'id': '********************, 'gatewayIp': None, 'cidr': '192.168.54.0/24'}]
```

Voyez vous ce que je loupe ? Y a-t-il un problème avec l'API ?


2 Antworten ( Latest reply on 2019-04-18 13:48:28 Von
JulienC24
)


ovh.exceptions.BadParametersError: Invalid input for field/attribute 0. Value: {u'subnet_id': u'', u'ip_address': u'192.168.54.71'}. Additional properties are not allowed (u'subnet_id' was unexpected)


Salut, il y avait en effet un bug dans l'api ovh qui envoyait un paramètre subnet vide à l'api openstack alors qu'elle devait simplement envoyer l'ip. Ça devrait être fixé maintenant, tu valides ?

Oui, je confirme : ça fonctionne de nouveau.

Merci :)