cloudflare
Version:
The official TypeScript library for the Cloudflare API
104 lines • 3.94 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Ramps = exports.BaseRamps = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
const path_1 = require("../../../internal/utils/path.js");
var BaseRamps = /* @__PURE__ */ (() => {
class BaseRamps extends resource_1.APIResource {
/**
* Creates ramps (network connections) for a CF1 Site.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const ramp of client.magicTransit.cf1Sites.ramps.create(
* '023e105f4ecef8ad9ca31a8372d0c353',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* body: [
* {
* source_ramp_id: '023e105f4ecef8ad9ca31a8372d0c353',
* type: 'gre',
* },
* ],
* },
* )) {
* // ...
* }
* ```
*/
create(cf1SiteID, params, options) {
const { account_id, body } = params;
return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/magic/cf1_sites/${cf1SiteID}/ramps`, (pagination_1.SinglePage), { body: body, method: 'post', ...options });
}
/**
* Lists ramps (network connections) associated with a CF1 Site. Ramps represent
* GRE tunnels, IPsec tunnels, interconnects, or MCONN links.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const ramp of client.magicTransit.cf1Sites.ramps.list(
* '023e105f4ecef8ad9ca31a8372d0c353',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(cf1SiteID, params, options) {
const { account_id } = params;
return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/magic/cf1_sites/${cf1SiteID}/ramps`, (pagination_1.SinglePage), options);
}
/**
* Deletes a specific ramp from a CF1 Site.
*
* @example
* ```ts
* const ramp =
* await client.magicTransit.cf1Sites.ramps.delete(
* '023e105f4ecef8ad9ca31a8372d0c353',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* cf1_site_id: '023e105f4ecef8ad9ca31a8372d0c353',
* },
* );
* ```
*/
delete(rampID, params, options) {
const { account_id, cf1_site_id } = params;
return this._client.delete((0, path_1.path) `/accounts/${account_id}/magic/cf1_sites/${cf1_site_id}/ramps/${rampID}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Gets a specific ramp for a CF1 Site.
*
* @example
* ```ts
* const ramp = await client.magicTransit.cf1Sites.ramps.get(
* '023e105f4ecef8ad9ca31a8372d0c353',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* cf1_site_id: '023e105f4ecef8ad9ca31a8372d0c353',
* },
* );
* ```
*/
get(rampID, params, options) {
const { account_id, cf1_site_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/magic/cf1_sites/${cf1_site_id}/ramps/${rampID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseRamps._key = Object.freeze([
'magicTransit',
'cf1Sites',
'ramps',
]);
return BaseRamps;
})();
exports.BaseRamps = BaseRamps;
class Ramps extends BaseRamps {
}
exports.Ramps = Ramps;
//# sourceMappingURL=ramps.js.map