@pantechdynamic/sdk 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +66 -4
- package/dist/index.cjs +252 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14344 -10222
- package/dist/index.d.ts +14344 -10222
- package/dist/index.js +252 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -700,6 +700,12 @@ var Databases = class extends APIResource {
|
|
|
700
700
|
resizeStorage(databaseId, body, options) {
|
|
701
701
|
return this._post(path`/databases/${databaseId}/resize-storage`, body, options);
|
|
702
702
|
}
|
|
703
|
+
getSnapshotSchedule(databaseId, options) {
|
|
704
|
+
return this._get(path`/databases/${databaseId}/snapshot-schedule`, void 0, options);
|
|
705
|
+
}
|
|
706
|
+
setSnapshotSchedule(databaseId, body, options) {
|
|
707
|
+
return this._put(path`/databases/${databaseId}/snapshot-schedule`, body, options);
|
|
708
|
+
}
|
|
703
709
|
};
|
|
704
710
|
var DatabaseSnapshots = class extends APIResource {
|
|
705
711
|
list(databaseId, params = {}, options) {
|
|
@@ -1448,12 +1454,33 @@ function cloudFailed(kind, id, failure, resource) {
|
|
|
1448
1454
|
);
|
|
1449
1455
|
}
|
|
1450
1456
|
var Migrate = class extends APIResource {
|
|
1451
|
-
/**
|
|
1457
|
+
/** The clouds Migrate can connect, and how it reads each. */
|
|
1458
|
+
providers = new CloudProviders(this._client);
|
|
1459
|
+
/** Read-only connections to your accounts in other clouds. */
|
|
1452
1460
|
connections = new CloudConnections(this._client);
|
|
1453
|
-
/** Reads of everything a connection
|
|
1461
|
+
/** Reads of everything a connection can see. */
|
|
1454
1462
|
scans = new CloudScans(this._client);
|
|
1455
|
-
/** Plans to move what a scan found to Pantech. Nothing is created until you apply the Terraform. */
|
|
1463
|
+
/** Plans to move what a scan found to Pantech. Nothing is created until you apply the Terraform or start a copy. */
|
|
1456
1464
|
migrations = new Migrations(this._client);
|
|
1465
|
+
/** A connection's opt-in copy access: the buckets Pantech may copy, through a separate copy role. */
|
|
1466
|
+
copyAccess = new CopyAccessResource(this._client);
|
|
1467
|
+
/** Copies of a source bucket's objects into a Pantech bucket. */
|
|
1468
|
+
bucketImports = new BucketImports(this._client);
|
|
1469
|
+
/** Copies of a planned server's disks into a new Pantech instance. */
|
|
1470
|
+
serverCopies = new ServerCopies(this._client);
|
|
1471
|
+
/** Moves of a planned database into one of your Pantech databases, through the Migrate agent. */
|
|
1472
|
+
databaseImports = new DatabaseImports(this._client);
|
|
1473
|
+
/** Moves of a planned Kubernetes cluster into one of your Pantech clusters. */
|
|
1474
|
+
kubernetesMoves = new KubernetesMoves(this._client);
|
|
1475
|
+
};
|
|
1476
|
+
var CloudProviders = class extends APIResource {
|
|
1477
|
+
/**
|
|
1478
|
+
* Every cloud Migrate can connect: how it reads each (`federated` or
|
|
1479
|
+
* `agent`), and whether a scan reads its spend and its people.
|
|
1480
|
+
*/
|
|
1481
|
+
list(options) {
|
|
1482
|
+
return this._get("/cloud-providers", void 0, options);
|
|
1483
|
+
}
|
|
1457
1484
|
};
|
|
1458
1485
|
var CloudConnections = class extends APIResource {
|
|
1459
1486
|
list(params = {}, options) {
|
|
@@ -1463,9 +1490,13 @@ var CloudConnections = class extends APIResource {
|
|
|
1463
1490
|
return this._listAll("/cloud-connections", params, options);
|
|
1464
1491
|
}
|
|
1465
1492
|
/**
|
|
1466
|
-
* Starts a connection
|
|
1493
|
+
* Starts a connection to `provider` (`aws` when left out). Its `setup` says
|
|
1494
|
+
* what to run in your cloud: for AWS, the CloudFormation template (and,
|
|
1467
1495
|
* when offered, a one-click `quick_create_url`) that creates the read-only
|
|
1468
|
-
* role
|
|
1496
|
+
* role, whose `RoleArn` output you send with `update`; for Google Cloud,
|
|
1497
|
+
* Azure and Huawei Cloud, a script whose output you send as `gcp`, `azure`
|
|
1498
|
+
* or `huawei` with `update`; for agent providers, how to make a read-only
|
|
1499
|
+
* token, then `enrollAgent`.
|
|
1469
1500
|
*/
|
|
1470
1501
|
create(body, options) {
|
|
1471
1502
|
return this._post("/cloud-connections", body, options);
|
|
@@ -1473,7 +1504,10 @@ var CloudConnections = class extends APIResource {
|
|
|
1473
1504
|
get(connectionId, options) {
|
|
1474
1505
|
return this._get(path`/cloud-connections/${connectionId}`, void 0, options);
|
|
1475
1506
|
}
|
|
1476
|
-
/**
|
|
1507
|
+
/**
|
|
1508
|
+
* Renames the connection, sets its `role_arn` (AWS) or its `gcp`, `azure`
|
|
1509
|
+
* or `huawei` federation details, or retries a failed check (`retry: true`).
|
|
1510
|
+
*/
|
|
1477
1511
|
update(connectionId, body, options) {
|
|
1478
1512
|
return this._patch(path`/cloud-connections/${connectionId}`, body, options);
|
|
1479
1513
|
}
|
|
@@ -1481,10 +1515,26 @@ var CloudConnections = class extends APIResource {
|
|
|
1481
1515
|
delete(connectionId, options) {
|
|
1482
1516
|
return this._delete(path`/cloud-connections/${connectionId}`, options);
|
|
1483
1517
|
}
|
|
1518
|
+
/**
|
|
1519
|
+
* For a connection read by the Pantech Migrate agent: a one-time enrollment
|
|
1520
|
+
* code, valid once for an hour and shown only in this response. Run its
|
|
1521
|
+
* `enroll_command` where the agent will run. Each call issues a new code
|
|
1522
|
+
* (replacing any unused one), so it is sent once and not retried.
|
|
1523
|
+
*/
|
|
1524
|
+
enrollAgent(connectionId, options) {
|
|
1525
|
+
return this._post(path`/cloud-connections/${connectionId}/agent-enrollments`, void 0, options, {
|
|
1526
|
+
noRetry: true
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
/** Ends the connection's agent at once; the connection waits for a new one. Revoking again changes nothing. */
|
|
1530
|
+
revokeAgent(connectionId, options) {
|
|
1531
|
+
return this._delete(path`/cloud-connections/${connectionId}/agent`, options);
|
|
1532
|
+
}
|
|
1484
1533
|
/**
|
|
1485
1534
|
* Polls the connection until it is `connected` (resolves with it) or its
|
|
1486
|
-
* check fails (rejects with CloudFailedError). Set the role ARN
|
|
1487
|
-
* `update
|
|
1535
|
+
* check fails (rejects with CloudFailedError). Set the role ARN or the
|
|
1536
|
+
* federation details with `update`, or enroll the agent, first. Default
|
|
1537
|
+
* timeout 10 minutes, polling every 5 seconds.
|
|
1488
1538
|
*/
|
|
1489
1539
|
wait(connectionId, options = {}) {
|
|
1490
1540
|
return poll(
|
|
@@ -1562,6 +1612,199 @@ var Migrations = class extends APIResource {
|
|
|
1562
1612
|
exportTerraform(migrationId, options) {
|
|
1563
1613
|
return this._get(path`/migrations/${migrationId}/terraform`, void 0, options);
|
|
1564
1614
|
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Sends Pantech invites to the people the plan lists (items of kind
|
|
1617
|
+
* `user`), by key, each with its item's role. Safe to repeat: anyone
|
|
1618
|
+
* already invited or already a member is reported, never invited twice.
|
|
1619
|
+
*/
|
|
1620
|
+
sendInvites(migrationId, body, options) {
|
|
1621
|
+
return this._post(path`/migrations/${migrationId}/invites`, body, options);
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
var CopyAccessResource = class extends APIResource {
|
|
1625
|
+
/** The connection's copy access: the chosen buckets, the copy role and its last verification, and its template. */
|
|
1626
|
+
get(connectionId, options) {
|
|
1627
|
+
return this._get(path`/cloud-connections/${connectionId}/copy-access`, void 0, options);
|
|
1628
|
+
}
|
|
1629
|
+
/**
|
|
1630
|
+
* Chooses the buckets Pantech may copy (`buckets`, needed the first time)
|
|
1631
|
+
* and returns the CloudFormation template for a copy role that may read
|
|
1632
|
+
* only those. Deploy it, then set `role_arn` to its `CopyRoleArn` output;
|
|
1633
|
+
* `retry: true` verifies again.
|
|
1634
|
+
*/
|
|
1635
|
+
set(connectionId, body, options) {
|
|
1636
|
+
return this._put(path`/cloud-connections/${connectionId}/copy-access`, body, options);
|
|
1637
|
+
}
|
|
1638
|
+
};
|
|
1639
|
+
var BucketImports = class extends APIResource {
|
|
1640
|
+
/** The organization's bucket imports, newest first. */
|
|
1641
|
+
list(params = {}, options) {
|
|
1642
|
+
return this._get("/bucket-imports", params, options);
|
|
1643
|
+
}
|
|
1644
|
+
listAll(params = {}, options) {
|
|
1645
|
+
return this._listAll("/bucket-imports", params, options);
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Copies one source bucket (with verified copy access) into a new Pantech
|
|
1649
|
+
* bucket (`destination_bucket_name`) or one you have (`destination_bucket_id`).
|
|
1650
|
+
* Nothing is deleted on either side. Follow it with `get`.
|
|
1651
|
+
*/
|
|
1652
|
+
start(body, options) {
|
|
1653
|
+
return this._post("/bucket-imports", body, options);
|
|
1654
|
+
}
|
|
1655
|
+
/** An import's status and progress, the first objects that failed it, and its audit trail. */
|
|
1656
|
+
get(importId, options) {
|
|
1657
|
+
return this._get(path`/bucket-imports/${importId}`, void 0, options);
|
|
1658
|
+
}
|
|
1659
|
+
/** Stops the import: a queued one at once, a running one at its next checkpoint. Objects already copied stay. */
|
|
1660
|
+
cancel(importId, options) {
|
|
1661
|
+
return this._post(path`/bucket-imports/${importId}/cancel`, void 0, options);
|
|
1662
|
+
}
|
|
1663
|
+
/**
|
|
1664
|
+
* Queues another pass that copies only what changed. `mirror_deletes: true`
|
|
1665
|
+
* (that pass only, needs the `delete` scope) also deletes the objects this
|
|
1666
|
+
* import copied that the source no longer has.
|
|
1667
|
+
*/
|
|
1668
|
+
resync(importId, body = {}, options) {
|
|
1669
|
+
return this._post(path`/bucket-imports/${importId}/resync`, body, options);
|
|
1670
|
+
}
|
|
1671
|
+
};
|
|
1672
|
+
var ServerCopies = class extends APIResource {
|
|
1673
|
+
/** Every server copy in your organization, newest first, with its progress. */
|
|
1674
|
+
list(params = {}, options) {
|
|
1675
|
+
return this._get("/server-copies", params, options);
|
|
1676
|
+
}
|
|
1677
|
+
listAll(params = {}, options) {
|
|
1678
|
+
return this._listAll("/server-copies", params, options);
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* Starts copying one planned server's disks (`item_key`) into a new Pantech
|
|
1682
|
+
* instance. The first pass copies every disk; `sync` copies what changed and
|
|
1683
|
+
* `cutOver` runs the last pass and builds the instance. `source` is `agent`
|
|
1684
|
+
* (the default) or `aws_snapshot`, with a copy role from `getTemplate`.
|
|
1685
|
+
*/
|
|
1686
|
+
start(migrationId, body, options) {
|
|
1687
|
+
return this._post(path`/migrations/${migrationId}/server-copies`, body, options);
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* The CloudFormation template of the AWS copy role for one planned server
|
|
1691
|
+
* (`item_key`); with `create_snapshots: true` it may also snapshot that
|
|
1692
|
+
* server's own volumes.
|
|
1693
|
+
*/
|
|
1694
|
+
getTemplate(migrationId, params, options) {
|
|
1695
|
+
return this._get(path`/migrations/${migrationId}/server-copy-template`, params, options);
|
|
1696
|
+
}
|
|
1697
|
+
/** A copy's status, pre-flight findings, running pass and progress, and the instance once it is being created. */
|
|
1698
|
+
get(copyId, options) {
|
|
1699
|
+
return this._get(path`/server-copies/${copyId}`, void 0, options);
|
|
1700
|
+
}
|
|
1701
|
+
/** Asks for a pass that copies only what changed. An AWS copy that makes no snapshots names each disk's new one in `snapshots`. */
|
|
1702
|
+
sync(copyId, body = {}, options) {
|
|
1703
|
+
return this._post(path`/server-copies/${copyId}/sync`, body, options);
|
|
1704
|
+
}
|
|
1705
|
+
/** Asks for the last pass, then builds the instance. Stop the application first. */
|
|
1706
|
+
cutOver(copyId, body = {}, options) {
|
|
1707
|
+
return this._post(path`/server-copies/${copyId}/cutover`, body, options);
|
|
1708
|
+
}
|
|
1709
|
+
/** Stops the copy and deletes what Pantech staged for it. Refused once the instance is being created. */
|
|
1710
|
+
cancel(copyId, body = {}, options) {
|
|
1711
|
+
return this._post(path`/server-copies/${copyId}/cancel`, body, options);
|
|
1712
|
+
}
|
|
1713
|
+
};
|
|
1714
|
+
var DatabaseImports = class extends APIResource {
|
|
1715
|
+
/** Your organization's database imports, newest first, without their tables. */
|
|
1716
|
+
list(params = {}, options) {
|
|
1717
|
+
return this._get("/database-imports", params, options);
|
|
1718
|
+
}
|
|
1719
|
+
listAll(params = {}, options) {
|
|
1720
|
+
return this._listAll("/database-imports", params, options);
|
|
1721
|
+
}
|
|
1722
|
+
/**
|
|
1723
|
+
* Starts moving one of the plan's databases (`item_key`) into one of your
|
|
1724
|
+
* Pantech databases, through the Migrate agent, which keeps the source's
|
|
1725
|
+
* credentials. `dump` copies once; `replicate` (PostgreSQL) follows changes
|
|
1726
|
+
* until you cut over.
|
|
1727
|
+
*/
|
|
1728
|
+
start(migrationId, body, options) {
|
|
1729
|
+
return this._post(path`/migrations/${migrationId}/database-imports`, body, options);
|
|
1730
|
+
}
|
|
1731
|
+
/** An import with its readiness report, per-table progress and verification. */
|
|
1732
|
+
get(importId, options) {
|
|
1733
|
+
return this._get(path`/database-imports/${importId}`, void 0, options);
|
|
1734
|
+
}
|
|
1735
|
+
/** Runs the pre-flight again, for example after fixing what it reported. Allowed before the copy starts. */
|
|
1736
|
+
checkReadiness(importId, options) {
|
|
1737
|
+
return this._post(path`/database-imports/${importId}/readiness`, void 0, options);
|
|
1738
|
+
}
|
|
1739
|
+
/** Finishes the import. For `replicate`, stop writes to the source first. */
|
|
1740
|
+
cutOver(importId, options) {
|
|
1741
|
+
return this._post(path`/database-imports/${importId}/cutover`, void 0, options);
|
|
1742
|
+
}
|
|
1743
|
+
/** Stops the import and removes its access to your Pantech database. What was copied stays. */
|
|
1744
|
+
cancel(importId, options) {
|
|
1745
|
+
return this._post(path`/database-imports/${importId}/cancel`, void 0, options);
|
|
1746
|
+
}
|
|
1747
|
+
/** Removes the import's login and access from your Pantech database now, keeping the data. */
|
|
1748
|
+
revokeAccess(importId, options) {
|
|
1749
|
+
return this._post(path`/database-imports/${importId}/revoke-access`, void 0, options);
|
|
1750
|
+
}
|
|
1751
|
+
};
|
|
1752
|
+
var KubernetesMoves = class extends APIResource {
|
|
1753
|
+
/** Your organization's moves, newest first, without their resources and volumes. */
|
|
1754
|
+
list(params = {}, options) {
|
|
1755
|
+
return this._get("/kubernetes-moves", params, options);
|
|
1756
|
+
}
|
|
1757
|
+
listAll(params = {}, options) {
|
|
1758
|
+
return this._listAll("/kubernetes-moves", params, options);
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* Starts moving a plan's `kubernetes_cluster` item into one of your running
|
|
1762
|
+
* Pantech clusters. Secrets move only with `include_secrets`, volume data
|
|
1763
|
+
* only with `copy_volumes`. Then `preview`, `apply`, and `cutOver`.
|
|
1764
|
+
*/
|
|
1765
|
+
start(migrationId, body, options) {
|
|
1766
|
+
return this._post(path`/migrations/${migrationId}/kubernetes-moves`, body, options);
|
|
1767
|
+
}
|
|
1768
|
+
/** The manifests to apply to the source cluster: a read-only reader, and optional Secrets reader and volume copier roles. */
|
|
1769
|
+
getSourceAccess(options) {
|
|
1770
|
+
return this._get("/kubernetes-moves/source-access", void 0, options);
|
|
1771
|
+
}
|
|
1772
|
+
/** A move with its report: every source object and what the move does with it, the volumes, images and held workloads. */
|
|
1773
|
+
get(moveId, options) {
|
|
1774
|
+
return this._get(path`/kubernetes-moves/${moveId}`, void 0, options);
|
|
1775
|
+
}
|
|
1776
|
+
/** Queues a server-side dry run against the target cluster. `allow_privileged` names refused workloads to include anyway. */
|
|
1777
|
+
preview(moveId, body = {}, options) {
|
|
1778
|
+
return this._post(path`/kubernetes-moves/${moveId}/preview`, body, options);
|
|
1779
|
+
}
|
|
1780
|
+
/** Queues the apply of what the last successful preview checked. */
|
|
1781
|
+
apply(moveId, options) {
|
|
1782
|
+
return this._post(path`/kubernetes-moves/${moveId}/apply`, void 0, options);
|
|
1783
|
+
}
|
|
1784
|
+
/** Queues the next copy of every volume; only what changed is sent. */
|
|
1785
|
+
syncVolumes(moveId, options) {
|
|
1786
|
+
return this._post(path`/kubernetes-moves/${moveId}/sync-volumes`, void 0, options);
|
|
1787
|
+
}
|
|
1788
|
+
/**
|
|
1789
|
+
* Once writes on the source have stopped (`source_writes_stopped: true`),
|
|
1790
|
+
* takes the final copy of every volume and scales the held workloads up.
|
|
1791
|
+
*/
|
|
1792
|
+
cutOver(moveId, body, options) {
|
|
1793
|
+
return this._post(path`/kubernetes-moves/${moveId}/cutover`, body, options);
|
|
1794
|
+
}
|
|
1795
|
+
/** Stops the move and removes its copy pods, staged data and export. Objects already applied stay. */
|
|
1796
|
+
cancel(moveId, options) {
|
|
1797
|
+
return this._post(path`/kubernetes-moves/${moveId}/cancel`, void 0, options);
|
|
1798
|
+
}
|
|
1799
|
+
/** The transformed manifests as one YAML file, for GitOps. Secret values are never included. */
|
|
1800
|
+
downloadManifests(moveId, options) {
|
|
1801
|
+
return this._request(
|
|
1802
|
+
"GET",
|
|
1803
|
+
path`/kubernetes-moves/${moveId}/manifests`,
|
|
1804
|
+
{ responseType: "text" },
|
|
1805
|
+
{ ...options, headers: { Accept: "application/yaml", ...options?.headers } }
|
|
1806
|
+
);
|
|
1807
|
+
}
|
|
1565
1808
|
};
|
|
1566
1809
|
|
|
1567
1810
|
// src/resources/networks.ts
|
|
@@ -2243,7 +2486,7 @@ var WebhookDeliveries = class extends APIResource {
|
|
|
2243
2486
|
};
|
|
2244
2487
|
|
|
2245
2488
|
// src/version.ts
|
|
2246
|
-
var VERSION = "0.
|
|
2489
|
+
var VERSION = "0.6.0";
|
|
2247
2490
|
|
|
2248
2491
|
// src/client.ts
|
|
2249
2492
|
var DEFAULT_BASE_URL = "https://api.pantechdynamics.com/public/v1";
|