Julien Fontanet
ce4bcbd19d
chore(xen-api): move more methods
2019-03-28 17:30:24 +01:00
Julien Fontanet
fe1da4ea12
chore(xen-api): _addObject → _addRecordToCache, _removeObject → _removeRecordFromCache
2019-03-28 16:17:53 +01:00
Julien Fontanet
a73306817b
chore(xen-api): move more methods
2019-03-28 16:15:09 +01:00
Julien Fontanet
54e683d3d4
chore(xen-api): move getField to object handling helpers section
2019-03-28 16:01:10 +01:00
Julien Fontanet
4052f7f736
chore(xen-api): regroup HTTP requests
2019-03-28 13:58:23 +01:00
Julien Fontanet
b47e097983
feat(xen-api/{get,put}Resource): add inactivity detection ( #4090 )
2019-03-28 13:55:56 +01:00
Julien Fontanet
e6aae8fcfa
chore(xen-api): regroup object handling helpers
2019-03-28 12:19:08 +01:00
Julien Fontanet
3a574bcecc
chore(xen-api): clean call/callAsync code
2019-03-28 12:14:03 +01:00
Julien Fontanet
1bb0e234e7
chore(xen-api): modularize ( #4088 )
2019-03-28 11:17:25 +01:00
Julien Fontanet
48ffa28e0b
fix(xen-api/_watchEvents): timeout must be a float
...
Required by XML-RPC transport (XenServer < 7.3).
2019-03-01 16:39:49 +01:00
Julien Fontanet
3279728e4b
chore(xen-api/events): prints errors
2019-03-01 13:42:13 +01:00
Julien Fontanet
fe0dcbacc5
fix(xen-api/_watchEvents): pTimeout expects milliseconds
2019-03-01 13:40:03 +01:00
Julien Fontanet
f91d4a07eb
fix(xen-api/_watchEvents): dont stop when fail to get records
2019-02-28 16:32:30 +01:00
Julien Fontanet
c5a5ef6c93
fix(xen-api/_watchEvents): dont fetch events while fetching tasks
...
When our tasks cache is desynchronized we re-fetch all tasks.
We must wait before fetching the next events to have fetch the tasks otherwise we risk a race condition.
2019-02-28 16:30:39 +01:00
Julien Fontanet
468a2c5bf3
fix(xen-api/connect): always pass params to _transporCall
2019-02-28 12:36:57 +01:00
Julien Fontanet
344e9e06d0
feat(xen-api/objects): buffer objects' events on initial fetch ( #3994 )
...
XO requires all objects to be available at the same time.
2019-02-26 15:03:33 +01:00
Julien Fontanet
d866bccf3b
chore(xen-api/getResource): options are optional
2019-02-26 14:44:55 +01:00
Julien Fontanet
59106aa29e
chore(xen-api/_watchEvents): new implementation ( #3990 )
...
- fetch each types independently: no more huge requests
- only fall back to legacy implementation if `event.inject` is not available
- can only watch certain types
- `Xapi#objectsFetched` is a promise which resolves when objects have been fetched
2019-02-26 09:45:21 +01:00
Julien Fontanet
4216a5808a
chore(xen-api/setFieldEntry): always returns undefined
2019-02-24 18:17:26 +01:00
Julien Fontanet
12a7000e36
fix(xen-api): correct $type for records from event
...
XenApi event system returns lowercased types which things difficult, for
instance, `Record#set_name_label` methods did not work for some VM
because the lib called `vm.set_name_label` instead of
`VM.set_name_label`.
To work-around this problem, a map of types from lowercased is
constructed at connection.
2019-02-24 18:17:26 +01:00
Julien Fontanet
66f685165e
feat(xen-api/Record#update_): easier use for single entry
...
```js
// before
await object.update_property({
entry: 'value',
})
// after
await object.update_property('entry', 'value')
```
2019-02-22 19:51:36 +01:00
Julien Fontanet
8e8b1c009a
feat(xen-api#unsetField): replaced by setField(_, null)
2019-02-22 19:51:36 +01:00
Julien Fontanet
705d069246
feat(xen-api#getField): get a specific record field
2019-02-22 19:51:35 +01:00
Julien Fontanet
58e8d75935
chore(xen-api/*setField*): take separate type and ref
2019-02-22 19:51:34 +01:00
Julien Fontanet
5eb1454e67
fix(xen-api/_transportCall): avoid logging session ID
2019-02-22 19:51:34 +01:00
Julien Fontanet
04b31db41b
feat(xen-api/getRecords): fetch multiple records
2019-02-22 19:51:33 +01:00
Julien Fontanet
0695bafb90
fix(xen-api#_transportCall): pTimeout.call
...
Fixes 8e116063b
2019-02-17 19:39:11 +01:00
Julien Fontanet
8e116063bf
feat(xen-api#_transportCall): timeout after 24 hours
2019-02-15 17:37:45 +01:00
Julien Fontanet
3f3b372f89
feat(xapi/Record#$xapi): link connection from record
2019-02-15 17:29:00 +01:00
Julien Fontanet
29b941868d
feat(xen-api): work-around empty VBD#VDI XenServer issue ( #3950 )
2019-02-07 16:44:42 +01:00
Julien Fontanet
9990439594
fix(xen-api#putResource): correctly handle redirection for non-stream body
...
Fixes xoa-support#1179
2019-01-25 16:46:12 +01:00
Julien Fontanet
29a7bd0cb2
fix(xen-api/wrapError): better handling of non-XAPI errors
...
Fixes #3880
2019-01-18 09:14:33 +01:00
Julien Fontanet
cfd956631b
chore: update http-request-plus to 0.7.1
2019-01-16 09:39:32 +01:00
Julien Fontanet
c38f21b76b
feat(xen-api#{get,put}Resource): add 24h timeout on HTTP requests ( #3834 )
...
The Xen API does not support longer requests and it's necessary to properly detect broken requests.
2019-01-11 10:19:38 +01:00
Julien Fontanet
b459f74a8c
fix(xen-api/getRecord): pass type and ref to _wrapRecord
2019-01-08 14:52:53 +01:00
Julien Fontanet
eac9ce597b
chore(xen-api/_watchEvents): dont return a promise
...
This removes potential unhandled rejection warnings.
2018-12-19 14:24:49 +01:00
Julien Fontanet
83760157ad
chore(xen-api): silence Bluebird warning
2018-12-17 15:32:52 +01:00
badrAZ
d3b6d1a97f
fix(xo-server/servers): always remove pool→connection association ( #3782 )
...
* fix(xo-server/servers): delete correctly the connection from the cashe
* useless findKey
* CHANGELOG
* fix error
* code improvement
* code improvement
* code improvement
* Update CHANGELOG.md
* fix errors
* Update xen-servers.js
* missing entry in CHANGELOG
2018-12-13 12:21:02 +01:00
badrAZ
05fa76dad3
feat(xo-server/xen-servers): prevent server connection when pool already connected ( #3724 )
...
See #2238
2018-11-28 10:42:55 +01:00
Julien Fontanet
dd50fc37fe
feat(xen-api): callTimeout option ( #3707 )
2018-11-20 10:12:58 +01:00
Julien Fontanet
f8fbb6b7d3
feat(xen-api): add call params to errors ( #3679 )
...
It also moves `.method` to `.call.method`, but it appears it was not currently used in our code.
2018-11-13 12:03:05 +01:00
Julien Fontanet
e6d90d2154
feat(xen-api): _wrapRecord() ( #3448 )
...
Objectives:
- reduced memory usage and perf enhancement due to:
- mutualization of fields and methods via prototype
- mutualization of hidden classes
- easier manipulation via helper methods:
- `await pool.set_name_label('my pool')`
- `await pool.update_other_config({ foo: 'bar', baz: null })`
2018-10-08 10:58:03 +02:00
Julien Fontanet
b3004a38aa
chore: update promise-toolbox to v0.10 ( #3392 )
2018-09-07 14:34:47 +02:00
Julien Fontanet
d66e8f29b7
feat(xen-api): add methods to mutate fields
...
- `setField()`
- `setFieldEntry()`
- `unsetFieldEntry()`
- `setFieldEntries()`
2018-08-21 18:15:38 +02:00
Julien Fontanet
3e9425bf79
feat(xen-api): add getRecordByUuid()
2018-08-21 17:49:37 +02:00
Julien Fontanet
41506e785e
feat(xen-api/getRecord): add $id, $type and $ref props
2018-08-21 17:48:58 +02:00
Julien Fontanet
32d7ccfea5
feat(xen-api): expose null reference
2018-08-21 17:46:59 +02:00
Julien Fontanet
8a9f952ada
feat(xen-api): support encoded credentials in URL
2018-08-21 17:46:18 +02:00
Julien Fontanet
266f287774
chore(xen-api): use Babel 7
2018-08-20 15:51:07 +02:00
Julien Fontanet
29fc17f260
fix(xen-api/putResource): ensure taskRef is not sent on probing
...
This fix an issue introduced in ba6b9682
Fixes #3293 .
2018-08-10 12:41:35 +02:00