mirror of https://github.com/hashicorp/consul
26 lines
562 B
JavaScript
26 lines
562 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import Adapter from './application';
|
|
|
|
// TODO: Update to use this.formatDatacenter()
|
|
export default class DiscoveryChainAdapter extends Adapter {
|
|
requestForQueryRecord(request, { dc, ns, partition, index, id, uri }) {
|
|
if (typeof id === 'undefined') {
|
|
throw new Error('You must specify an id');
|
|
}
|
|
return request`
|
|
GET /v1/discovery-chain/${id}?${{ dc }}
|
|
X-Request-ID: ${uri}
|
|
|
|
${{
|
|
ns,
|
|
partition,
|
|
index,
|
|
}}
|
|
`;
|
|
}
|
|
}
|