@pantechdynamic/sdk 0.5.0 → 0.6.1

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/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
- /** Connections to AWS accounts through a read-only role only Pantech can assume. */
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's role can see. */
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. Its `setup` holds the CloudFormation template (and,
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 in your AWS account; send the stack's `RoleArn` output with `update`.
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
- /** Renames the connection, sets its `role_arn`, or retries a failed check (`retry: true`). */
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,33 @@ var CloudConnections = class extends APIResource {
1481
1515
  delete(connectionId, options) {
1482
1516
  return this._delete(path`/cloud-connections/${connectionId}`, options);
1483
1517
  }
1518
+ /**
1519
+ * A one-time enrollment code for the connection's Pantech Migrate agent,
1520
+ * valid once for an hour and shown only in this response. Any connection may
1521
+ * have an agent: on AWS, Google Cloud, Azure and Huawei Cloud it runs server
1522
+ * copies, database imports and Kubernetes moves (Pantech scans those clouds
1523
+ * itself); on the other clouds it scans too. A connection has one agent, so
1524
+ * using the code replaces the earlier one. Run its `enroll_command` where the
1525
+ * agent will run. Each call issues a new code (replacing any unused one), so
1526
+ * it is sent once and not retried.
1527
+ */
1528
+ enrollAgent(connectionId, options) {
1529
+ return this._post(path`/cloud-connections/${connectionId}/agent-enrollments`, void 0, options, {
1530
+ noRetry: true
1531
+ });
1532
+ }
1533
+ /**
1534
+ * Ends the connection's agent at once, and any server copy upload it was
1535
+ * running; the connection waits for a new one. Revoking again changes nothing.
1536
+ */
1537
+ revokeAgent(connectionId, options) {
1538
+ return this._delete(path`/cloud-connections/${connectionId}/agent`, options);
1539
+ }
1484
1540
  /**
1485
1541
  * Polls the connection until it is `connected` (resolves with it) or its
1486
- * check fails (rejects with CloudFailedError). Set the role ARN with
1487
- * `update` first. Default timeout 10 minutes, polling every 5 seconds.
1542
+ * check fails (rejects with CloudFailedError). Set the role ARN or the
1543
+ * federation details with `update`, or enroll the agent, first. Default
1544
+ * timeout 10 minutes, polling every 5 seconds.
1488
1545
  */
1489
1546
  wait(connectionId, options = {}) {
1490
1547
  return poll(
@@ -1562,6 +1619,199 @@ var Migrations = class extends APIResource {
1562
1619
  exportTerraform(migrationId, options) {
1563
1620
  return this._get(path`/migrations/${migrationId}/terraform`, void 0, options);
1564
1621
  }
1622
+ /**
1623
+ * Sends Pantech invites to the people the plan lists (items of kind
1624
+ * `user`), by key, each with its item's role. Safe to repeat: anyone
1625
+ * already invited or already a member is reported, never invited twice.
1626
+ */
1627
+ sendInvites(migrationId, body, options) {
1628
+ return this._post(path`/migrations/${migrationId}/invites`, body, options);
1629
+ }
1630
+ };
1631
+ var CopyAccessResource = class extends APIResource {
1632
+ /** The connection's copy access: the chosen buckets, the copy role and its last verification, and its template. */
1633
+ get(connectionId, options) {
1634
+ return this._get(path`/cloud-connections/${connectionId}/copy-access`, void 0, options);
1635
+ }
1636
+ /**
1637
+ * Chooses the buckets Pantech may copy (`buckets`, needed the first time)
1638
+ * and returns the CloudFormation template for a copy role that may read
1639
+ * only those. Deploy it, then set `role_arn` to its `CopyRoleArn` output;
1640
+ * `retry: true` verifies again.
1641
+ */
1642
+ set(connectionId, body, options) {
1643
+ return this._put(path`/cloud-connections/${connectionId}/copy-access`, body, options);
1644
+ }
1645
+ };
1646
+ var BucketImports = class extends APIResource {
1647
+ /** The organization's bucket imports, newest first. */
1648
+ list(params = {}, options) {
1649
+ return this._get("/bucket-imports", params, options);
1650
+ }
1651
+ listAll(params = {}, options) {
1652
+ return this._listAll("/bucket-imports", params, options);
1653
+ }
1654
+ /**
1655
+ * Copies one source bucket (with verified copy access) into a new Pantech
1656
+ * bucket (`destination_bucket_name`) or one you have (`destination_bucket_id`).
1657
+ * Nothing is deleted on either side. Follow it with `get`.
1658
+ */
1659
+ start(body, options) {
1660
+ return this._post("/bucket-imports", body, options);
1661
+ }
1662
+ /** An import's status and progress, the first objects that failed it, and its audit trail. */
1663
+ get(importId, options) {
1664
+ return this._get(path`/bucket-imports/${importId}`, void 0, options);
1665
+ }
1666
+ /** Stops the import: a queued one at once, a running one at its next checkpoint. Objects already copied stay. */
1667
+ cancel(importId, options) {
1668
+ return this._post(path`/bucket-imports/${importId}/cancel`, void 0, options);
1669
+ }
1670
+ /**
1671
+ * Queues another pass that copies only what changed. `mirror_deletes: true`
1672
+ * (that pass only, needs the `delete` scope) also deletes the objects this
1673
+ * import copied that the source no longer has.
1674
+ */
1675
+ resync(importId, body = {}, options) {
1676
+ return this._post(path`/bucket-imports/${importId}/resync`, body, options);
1677
+ }
1678
+ };
1679
+ var ServerCopies = class extends APIResource {
1680
+ /** Every server copy in your organization, newest first, with its progress. */
1681
+ list(params = {}, options) {
1682
+ return this._get("/server-copies", params, options);
1683
+ }
1684
+ listAll(params = {}, options) {
1685
+ return this._listAll("/server-copies", params, options);
1686
+ }
1687
+ /**
1688
+ * Starts copying one planned server's disks (`item_key`) into a new Pantech
1689
+ * instance. The first pass copies every disk; `sync` copies what changed and
1690
+ * `cutOver` runs the last pass and builds the instance. `source` is `agent`
1691
+ * (the default) or `aws_snapshot`, with a copy role from `getTemplate`.
1692
+ */
1693
+ start(migrationId, body, options) {
1694
+ return this._post(path`/migrations/${migrationId}/server-copies`, body, options);
1695
+ }
1696
+ /**
1697
+ * The CloudFormation template of the AWS copy role for one planned server
1698
+ * (`item_key`); with `create_snapshots: true` it may also snapshot that
1699
+ * server's own volumes.
1700
+ */
1701
+ getTemplate(migrationId, params, options) {
1702
+ return this._get(path`/migrations/${migrationId}/server-copy-template`, params, options);
1703
+ }
1704
+ /** A copy's status, pre-flight findings, running pass and progress, and the instance once it is being created. */
1705
+ get(copyId, options) {
1706
+ return this._get(path`/server-copies/${copyId}`, void 0, options);
1707
+ }
1708
+ /** Asks for a pass that copies only what changed. An AWS copy that makes no snapshots names each disk's new one in `snapshots`. */
1709
+ sync(copyId, body = {}, options) {
1710
+ return this._post(path`/server-copies/${copyId}/sync`, body, options);
1711
+ }
1712
+ /** Asks for the last pass, then builds the instance. Stop the application first. */
1713
+ cutOver(copyId, body = {}, options) {
1714
+ return this._post(path`/server-copies/${copyId}/cutover`, body, options);
1715
+ }
1716
+ /** Stops the copy and deletes what Pantech staged for it. Refused once the instance is being created. */
1717
+ cancel(copyId, body = {}, options) {
1718
+ return this._post(path`/server-copies/${copyId}/cancel`, body, options);
1719
+ }
1720
+ };
1721
+ var DatabaseImports = class extends APIResource {
1722
+ /** Your organization's database imports, newest first, without their tables. */
1723
+ list(params = {}, options) {
1724
+ return this._get("/database-imports", params, options);
1725
+ }
1726
+ listAll(params = {}, options) {
1727
+ return this._listAll("/database-imports", params, options);
1728
+ }
1729
+ /**
1730
+ * Starts moving one of the plan's databases (`item_key`) into one of your
1731
+ * Pantech databases, through the Migrate agent, which keeps the source's
1732
+ * credentials. `dump` copies once; `replicate` (PostgreSQL) follows changes
1733
+ * until you cut over.
1734
+ */
1735
+ start(migrationId, body, options) {
1736
+ return this._post(path`/migrations/${migrationId}/database-imports`, body, options);
1737
+ }
1738
+ /** An import with its readiness report, per-table progress and verification. */
1739
+ get(importId, options) {
1740
+ return this._get(path`/database-imports/${importId}`, void 0, options);
1741
+ }
1742
+ /** Runs the pre-flight again, for example after fixing what it reported. Allowed before the copy starts. */
1743
+ checkReadiness(importId, options) {
1744
+ return this._post(path`/database-imports/${importId}/readiness`, void 0, options);
1745
+ }
1746
+ /** Finishes the import. For `replicate`, stop writes to the source first. */
1747
+ cutOver(importId, options) {
1748
+ return this._post(path`/database-imports/${importId}/cutover`, void 0, options);
1749
+ }
1750
+ /** Stops the import and removes its access to your Pantech database. What was copied stays. */
1751
+ cancel(importId, options) {
1752
+ return this._post(path`/database-imports/${importId}/cancel`, void 0, options);
1753
+ }
1754
+ /** Removes the import's login and access from your Pantech database now, keeping the data. */
1755
+ revokeAccess(importId, options) {
1756
+ return this._post(path`/database-imports/${importId}/revoke-access`, void 0, options);
1757
+ }
1758
+ };
1759
+ var KubernetesMoves = class extends APIResource {
1760
+ /** Your organization's moves, newest first, without their resources and volumes. */
1761
+ list(params = {}, options) {
1762
+ return this._get("/kubernetes-moves", params, options);
1763
+ }
1764
+ listAll(params = {}, options) {
1765
+ return this._listAll("/kubernetes-moves", params, options);
1766
+ }
1767
+ /**
1768
+ * Starts moving a plan's `kubernetes_cluster` item into one of your running
1769
+ * Pantech clusters. Secrets move only with `include_secrets`, volume data
1770
+ * only with `copy_volumes`. Then `preview`, `apply`, and `cutOver`.
1771
+ */
1772
+ start(migrationId, body, options) {
1773
+ return this._post(path`/migrations/${migrationId}/kubernetes-moves`, body, options);
1774
+ }
1775
+ /** The manifests to apply to the source cluster: a read-only reader, and optional Secrets reader and volume copier roles. */
1776
+ getSourceAccess(options) {
1777
+ return this._get("/kubernetes-moves/source-access", void 0, options);
1778
+ }
1779
+ /** A move with its report: every source object and what the move does with it, the volumes, images and held workloads. */
1780
+ get(moveId, options) {
1781
+ return this._get(path`/kubernetes-moves/${moveId}`, void 0, options);
1782
+ }
1783
+ /** Queues a server-side dry run against the target cluster. `allow_privileged` names refused workloads to include anyway. */
1784
+ preview(moveId, body = {}, options) {
1785
+ return this._post(path`/kubernetes-moves/${moveId}/preview`, body, options);
1786
+ }
1787
+ /** Queues the apply of what the last successful preview checked. */
1788
+ apply(moveId, options) {
1789
+ return this._post(path`/kubernetes-moves/${moveId}/apply`, void 0, options);
1790
+ }
1791
+ /** Queues the next copy of every volume; only what changed is sent. */
1792
+ syncVolumes(moveId, options) {
1793
+ return this._post(path`/kubernetes-moves/${moveId}/sync-volumes`, void 0, options);
1794
+ }
1795
+ /**
1796
+ * Once writes on the source have stopped (`source_writes_stopped: true`),
1797
+ * takes the final copy of every volume and scales the held workloads up.
1798
+ */
1799
+ cutOver(moveId, body, options) {
1800
+ return this._post(path`/kubernetes-moves/${moveId}/cutover`, body, options);
1801
+ }
1802
+ /** Stops the move and removes its copy pods, staged data and export. Objects already applied stay. */
1803
+ cancel(moveId, options) {
1804
+ return this._post(path`/kubernetes-moves/${moveId}/cancel`, void 0, options);
1805
+ }
1806
+ /** The transformed manifests as one YAML file, for GitOps. Secret values are never included. */
1807
+ downloadManifests(moveId, options) {
1808
+ return this._request(
1809
+ "GET",
1810
+ path`/kubernetes-moves/${moveId}/manifests`,
1811
+ { responseType: "text" },
1812
+ { ...options, headers: { Accept: "application/yaml", ...options?.headers } }
1813
+ );
1814
+ }
1565
1815
  };
1566
1816
 
1567
1817
  // src/resources/networks.ts
@@ -2243,7 +2493,7 @@ var WebhookDeliveries = class extends APIResource {
2243
2493
  };
2244
2494
 
2245
2495
  // src/version.ts
2246
- var VERSION = "0.5.0";
2496
+ var VERSION = "0.6.1";
2247
2497
 
2248
2498
  // src/client.ts
2249
2499
  var DEFAULT_BASE_URL = "https://api.pantechdynamics.com/public/v1";