-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
call replication/mode/status endpoint and add to cluster model
- Loading branch information
Showing
5 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import ApplicationAdapter from './application'; | ||
|
||
export default ApplicationAdapter.extend({ | ||
queryRecord() { | ||
return this.ajax(this.urlForQuery(), 'GET', { unauthenticated: true }).then(resp => { | ||
resp.id = resp.request_id; | ||
return resp; | ||
}); | ||
}, | ||
urlForQuery() { | ||
// TODO | ||
// return this.buildURL() + `/replication/${mode}/status`; | ||
return this.buildURL() + `/replication/performance/status`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import DS from 'ember-data'; | ||
const { attr } = DS; | ||
|
||
/* sample response | ||
{ | ||
"request_id": "d81bba81-e8a1-0ee9-240e-a77d36e3e08f", | ||
"lease_id": "", | ||
"renewable": false, | ||
"lease_duration": 0, | ||
"data": { | ||
"cluster_id": "ab7d4191-d1a3-b4d6-6297-5a41af6154ae", | ||
"known_secondaries": [ | ||
"test" | ||
], | ||
"last_performance_wal": 72, | ||
"last_reindex_epoch": "1588281113", | ||
"last_wal": 73, | ||
"merkle_root": "c8d258d376f01d98156f74e8d8f82ea2aca8dc4a", | ||
"mode": "primary", | ||
"primary_cluster_addr": "", | ||
"reindex_building_progress": 26838, | ||
"reindex_building_total": 305443, | ||
"reindex_in_progress": true, | ||
"reindex_stage": "building", | ||
"state": "running" | ||
}, | ||
"wrap_info": null, | ||
"warnings": null, | ||
"auth": null | ||
} | ||
*/ | ||
|
||
export default DS.Model.extend({ | ||
status: attr('object'), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import ApplicationSerializer from './application'; | ||
|
||
export default ApplicationSerializer.extend({ | ||
normalizeResponse(store, primaryModelClass, payload, id, requestType) { | ||
const normalizedPayload = { | ||
id: payload.id, | ||
status: payload.data, | ||
}; | ||
|
||
return this._super(store, primaryModelClass, normalizedPayload, id, requestType); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters