consul/ui/packages/consul-ui/app/adapters/discovery-chain.js

26 lines
563 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
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,
}}
`;
}
}