From ca6810635235959da2945a9df4f39522dda21f51 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Thu, 11 Jul 2024 11:39:21 -0400 Subject: [PATCH 1/7] Re-apply "new: Add support for Linode Disk Encryption (#413)" This reverts commit 6031fd410f4c849c537e0b9f9ddb65a0425f7931. --- linode_api4/groups/linode.py | 17 ++++++- linode_api4/objects/linode.py | 49 +++++++++++++++++- linode_api4/objects/lke.py | 1 + test/fixtures/linode_instances.json | 4 ++ test/fixtures/linode_instances_123_disks.json | 6 ++- ...inode_instances_123_disks_12345_clone.json | 3 +- .../lke_clusters_18881_nodes_123456.json | 2 +- .../lke_clusters_18881_pools_456.json | 3 +- test/integration/helpers.py | 6 ++- test/integration/models/linode/test_linode.py | 50 +++++++++++++++++-- test/integration/models/lke/test_lke.py | 21 ++++++-- test/unit/objects/linode_test.py | 29 +++++++++-- test/unit/objects/lke_test.py | 6 ++- 13 files changed, 177 insertions(+), 20 deletions(-) diff --git a/linode_api4/groups/linode.py b/linode_api4/groups/linode.py index 5f69d2b94..c146ce46c 100644 --- a/linode_api4/groups/linode.py +++ b/linode_api4/groups/linode.py @@ -1,7 +1,9 @@ import base64 import os from collections.abc import Iterable +from typing import Optional, Union +from linode_api4 import InstanceDiskEncryptionType from linode_api4.common import load_and_validate_keys from linode_api4.errors import UnexpectedResponseError from linode_api4.groups import Group @@ -128,7 +130,15 @@ def kernels(self, *filters): # create things def instance_create( - self, ltype, region, image=None, authorized_keys=None, **kwargs + self, + ltype, + region, + image=None, + authorized_keys=None, + disk_encryption: Optional[ + Union[InstanceDiskEncryptionType, str] + ] = None, + **kwargs, ): """ Creates a new Linode Instance. This function has several modes of operation: @@ -263,6 +273,8 @@ def instance_create( :type metadata: dict :param firewall: The firewall to attach this Linode to. :type firewall: int or Firewall + :param disk_encryption: The disk encryption policy for this Linode. + :type disk_encryption: InstanceDiskEncryptionType or str :param interfaces: An array of Network Interfaces to add to this Linode’s Configuration Profile. At least one and up to three Interface objects can exist in this array. :type interfaces: list[ConfigInterface] or list[dict[str, Any]] @@ -330,6 +342,9 @@ def instance_create( "authorized_keys": authorized_keys, } + if disk_encryption is not None: + params["disk_encryption"] = str(disk_encryption) + params.update(kwargs) result = self.client.post("/linode/instances", data=params) diff --git a/linode_api4/objects/linode.py b/linode_api4/objects/linode.py index d86ec1746..afcf6c2d5 100644 --- a/linode_api4/objects/linode.py +++ b/linode_api4/objects/linode.py @@ -22,12 +22,25 @@ from linode_api4.objects.base import MappedObject from linode_api4.objects.filtering import FilterableAttribute from linode_api4.objects.networking import IPAddress, IPv6Range, VPCIPAddress +from linode_api4.objects.serializable import StrEnum from linode_api4.objects.vpc import VPC, VPCSubnet from linode_api4.paginated_list import PaginatedList PASSWORD_CHARS = string.ascii_letters + string.digits + string.punctuation +class InstanceDiskEncryptionType(StrEnum): + """ + InstanceDiskEncryptionType defines valid values for the + Instance(...).disk_encryption field. + + API Documentation: TODO + """ + + enabled = "enabled" + disabled = "disabled" + + class Backup(DerivedBase): """ A Backup of a Linode Instance. @@ -114,6 +127,7 @@ class Disk(DerivedBase): "filesystem": Property(), "updated": Property(is_datetime=True), "linode_id": Property(identifier=True), + "disk_encryption": Property(), } def duplicate(self): @@ -662,6 +676,8 @@ class Instance(Base): "host_uuid": Property(), "watchdog_enabled": Property(mutable=True), "has_user_data": Property(), + "disk_encryption": Property(), + "lke_cluster_id": Property(), } @property @@ -1391,7 +1407,16 @@ def ip_allocate(self, public=False): i = IPAddress(self._client, result["address"], result) return i - def rebuild(self, image, root_pass=None, authorized_keys=None, **kwargs): + def rebuild( + self, + image, + root_pass=None, + authorized_keys=None, + disk_encryption: Optional[ + Union[InstanceDiskEncryptionType, str] + ] = None, + **kwargs, + ): """ Rebuilding an Instance deletes all existing Disks and Configs and deploys a new :any:`Image` to it. This can be used to reset an existing @@ -1409,6 +1434,8 @@ def rebuild(self, image, root_pass=None, authorized_keys=None, **kwargs): be a single key, or a path to a file containing the key. :type authorized_keys: list or str + :param disk_encryption: The disk encryption policy for this Linode. + :type disk_encryption: InstanceDiskEncryptionType or str :returns: The newly generated password, if one was not provided (otherwise True) @@ -1426,6 +1453,10 @@ def rebuild(self, image, root_pass=None, authorized_keys=None, **kwargs): "root_pass": root_pass, "authorized_keys": authorized_keys, } + + if disk_encryption is not None: + params["disk_encryption"] = str(disk_encryption) + params.update(kwargs) result = self._client.post( @@ -1755,6 +1786,22 @@ def stats(self): "{}/stats".format(Instance.api_endpoint), model=self ) + @property + def lke_cluster(self) -> Optional["LKECluster"]: + """ + Returns the LKE Cluster this Instance is a node of. + + :returns: The LKE Cluster this Instance is a node of. + :rtype: Optional[LKECluster] + """ + + # Local import to prevent circular dependency + from linode_api4.objects.lke import ( # pylint: disable=import-outside-toplevel + LKECluster, + ) + + return LKECluster(self._client, self.lke_cluster_id) + def stats_for(self, dt): """ Returns stats for the month containing the given datetime diff --git a/linode_api4/objects/lke.py b/linode_api4/objects/lke.py index 4d3ec5a16..14f7f28db 100644 --- a/linode_api4/objects/lke.py +++ b/linode_api4/objects/lke.py @@ -132,6 +132,7 @@ class LKENodePool(DerivedBase): "cluster_id": Property(identifier=True), "type": Property(slug_relationship=Type), "disks": Property(), + "disk_encryption": Property(), "count": Property(mutable=True), "nodes": Property( volatile=True diff --git a/test/fixtures/linode_instances.json b/test/fixtures/linode_instances.json index 651fc56c1..130d44285 100644 --- a/test/fixtures/linode_instances.json +++ b/test/fixtures/linode_instances.json @@ -41,6 +41,8 @@ "tags": ["something"], "host_uuid": "3a3ddd59d9a78bb8de041391075df44de62bfec8", "watchdog_enabled": true, + "disk_encryption": "disabled", + "lke_cluster_id": null, "placement_group": { "id": 123, "label": "test", @@ -86,6 +88,8 @@ "tags": [], "host_uuid": "3a3ddd59d9a78bb8de041391075df44de62bfec8", "watchdog_enabled": false, + "disk_encryption": "enabled", + "lke_cluster_id": 18881, "placement_group": null } ] diff --git a/test/fixtures/linode_instances_123_disks.json b/test/fixtures/linode_instances_123_disks.json index eca5079e5..ddfe7f313 100644 --- a/test/fixtures/linode_instances_123_disks.json +++ b/test/fixtures/linode_instances_123_disks.json @@ -10,7 +10,8 @@ "id": 12345, "updated": "2017-01-01T00:00:00", "label": "Ubuntu 17.04 Disk", - "created": "2017-01-01T00:00:00" + "created": "2017-01-01T00:00:00", + "disk_encryption": "disabled" }, { "size": 512, @@ -19,7 +20,8 @@ "id": 12346, "updated": "2017-01-01T00:00:00", "label": "512 MB Swap Image", - "created": "2017-01-01T00:00:00" + "created": "2017-01-01T00:00:00", + "disk_encryption": "disabled" } ] } diff --git a/test/fixtures/linode_instances_123_disks_12345_clone.json b/test/fixtures/linode_instances_123_disks_12345_clone.json index 2d378edca..899833e56 100644 --- a/test/fixtures/linode_instances_123_disks_12345_clone.json +++ b/test/fixtures/linode_instances_123_disks_12345_clone.json @@ -5,6 +5,7 @@ "id": 12345, "updated": "2017-01-01T00:00:00", "label": "Ubuntu 17.04 Disk", - "created": "2017-01-01T00:00:00" + "created": "2017-01-01T00:00:00", + "disk_encryption": "disabled" } \ No newline at end of file diff --git a/test/fixtures/lke_clusters_18881_nodes_123456.json b/test/fixtures/lke_clusters_18881_nodes_123456.json index 311ef3878..646b62f5d 100644 --- a/test/fixtures/lke_clusters_18881_nodes_123456.json +++ b/test/fixtures/lke_clusters_18881_nodes_123456.json @@ -1,5 +1,5 @@ { "id": "123456", - "instance_id": 123458, + "instance_id": 456, "status": "ready" } \ No newline at end of file diff --git a/test/fixtures/lke_clusters_18881_pools_456.json b/test/fixtures/lke_clusters_18881_pools_456.json index ec6b570ac..225023d5d 100644 --- a/test/fixtures/lke_clusters_18881_pools_456.json +++ b/test/fixtures/lke_clusters_18881_pools_456.json @@ -23,5 +23,6 @@ "example tag", "another example" ], - "type": "g6-standard-4" + "type": "g6-standard-4", + "disk_encryption": "enabled" } \ No newline at end of file diff --git a/test/integration/helpers.py b/test/integration/helpers.py index 5e9d1c441..e0aab06c4 100644 --- a/test/integration/helpers.py +++ b/test/integration/helpers.py @@ -79,12 +79,14 @@ def wait_for_condition( # Retry function to help in case of requests sending too quickly before instance is ready -def retry_sending_request(retries: int, condition: Callable, *args) -> object: +def retry_sending_request( + retries: int, condition: Callable, *args, **kwargs +) -> object: curr_t = 0 while curr_t < retries: try: curr_t += 1 - res = condition(*args) + res = condition(*args, **kwargs) return res except ApiError: if curr_t >= retries: diff --git a/test/integration/models/linode/test_linode.py b/test/integration/models/linode/test_linode.py index 02b6220a3..01f3aaa16 100644 --- a/test/integration/models/linode/test_linode.py +++ b/test/integration/models/linode/test_linode.py @@ -1,4 +1,5 @@ import time +from test.integration.conftest import get_region from test.integration.helpers import ( get_test_label, retry_sending_request, @@ -18,7 +19,7 @@ Instance, Type, ) -from linode_api4.objects.linode import MigrationType +from linode_api4.objects.linode import InstanceDiskEncryptionType, MigrationType @pytest.fixture(scope="session") @@ -142,6 +143,30 @@ def create_linode_for_long_running_tests(test_linode_client, e2e_test_firewall): linode_instance.delete() +@pytest.fixture(scope="function") +def linode_with_disk_encryption(test_linode_client, request): + client = test_linode_client + + target_region = get_region(client, {"Disk Encryption"}) + timestamp = str(time.time_ns()) + label = "TestSDK-" + timestamp + + disk_encryption = request.param + + linode_instance, password = client.linode.instance_create( + "g6-nanode-1", + target_region, + image="linode/ubuntu23.04", + label=label, + booted=False, + disk_encryption=disk_encryption, + ) + + yield linode_instance + + linode_instance.delete() + + # Test helper def get_status(linode: Instance, status: str): return linode.status == status @@ -170,8 +195,7 @@ def test_linode_transfer(test_linode_client, linode_with_volume_firewall): def test_linode_rebuild(test_linode_client): client = test_linode_client - available_regions = client.regions() - chosen_region = available_regions[4] + chosen_region = get_region(client, {"Disk Encryption"}) label = get_test_label() + "_rebuild" linode, password = client.linode.instance_create( @@ -180,12 +204,18 @@ def test_linode_rebuild(test_linode_client): wait_for_condition(10, 100, get_status, linode, "running") - retry_sending_request(3, linode.rebuild, "linode/debian10") + retry_sending_request( + 3, + linode.rebuild, + "linode/debian10", + disk_encryption=InstanceDiskEncryptionType.disabled, + ) wait_for_condition(10, 100, get_status, linode, "rebuilding") assert linode.status == "rebuilding" assert linode.image.id == "linode/debian10" + assert linode.disk_encryption == InstanceDiskEncryptionType.disabled wait_for_condition(10, 300, get_status, linode, "running") @@ -388,6 +418,18 @@ def test_linode_volumes(linode_with_volume_firewall): assert "test" in volumes[0].label +@pytest.mark.parametrize( + "linode_with_disk_encryption", ["disabled"], indirect=True +) +def test_linode_with_disk_encryption_disabled(linode_with_disk_encryption): + linode = linode_with_disk_encryption + + assert linode.disk_encryption == InstanceDiskEncryptionType.disabled + assert ( + linode.disks[0].disk_encryption == InstanceDiskEncryptionType.disabled + ) + + def wait_for_disk_status(disk: Disk, timeout): start_time = time.time() while True: diff --git a/test/integration/models/lke/test_lke.py b/test/integration/models/lke/test_lke.py index 2e74c8205..ce6700b80 100644 --- a/test/integration/models/lke/test_lke.py +++ b/test/integration/models/lke/test_lke.py @@ -1,14 +1,17 @@ import base64 import re +from test.integration.conftest import get_region from test.integration.helpers import ( get_test_label, send_request_when_resource_available, wait_for_condition, ) +from typing import Any, Dict import pytest from linode_api4 import ( + InstanceDiskEncryptionType, LKEClusterControlPlaneACLAddressesOptions, LKEClusterControlPlaneACLOptions, LKEClusterControlPlaneOptions, @@ -21,7 +24,7 @@ def lke_cluster(test_linode_client): node_type = test_linode_client.linode.types()[1] # g6-standard-1 version = test_linode_client.lke.versions()[0] - region = test_linode_client.regions().first() + region = get_region(test_linode_client, {"Disk Encryption", "Kubernetes"}) node_pools = test_linode_client.lke.node_pool(node_type, 3) label = get_test_label() + "_cluster" @@ -38,7 +41,7 @@ def lke_cluster(test_linode_client): def lke_cluster_with_acl(test_linode_client): node_type = test_linode_client.linode.types()[1] # g6-standard-1 version = test_linode_client.lke.versions()[0] - region = test_linode_client.regions().first() + region = get_region(test_linode_client, {"Kubernetes"}) node_pools = test_linode_client.lke.node_pool(node_type, 1) label = get_test_label() + "_cluster" @@ -81,9 +84,21 @@ def test_get_lke_clusters(test_linode_client, lke_cluster): def test_get_lke_pool(test_linode_client, lke_cluster): cluster = lke_cluster + wait_for_condition( + 10, + 500, + get_node_status, + cluster, + "ready", + ) + pool = test_linode_client.load(LKENodePool, cluster.pools[0].id, cluster.id) - assert cluster.pools[0].id == pool.id + def _to_comparable(p: LKENodePool) -> Dict[str, Any]: + return {k: v for k, v in p._raw_json.items() if k not in {"nodes"}} + + assert _to_comparable(cluster.pools[0]) == _to_comparable(pool) + assert pool.disk_encryption == InstanceDiskEncryptionType.enabled def test_cluster_dashboard_url_view(lke_cluster): diff --git a/test/unit/objects/linode_test.py b/test/unit/objects/linode_test.py index 8b03cbe7c..e24f1107c 100644 --- a/test/unit/objects/linode_test.py +++ b/test/unit/objects/linode_test.py @@ -1,7 +1,11 @@ from datetime import datetime from test.unit.base import ClientBaseCase -from linode_api4 import InstancePlacementGroupAssignment, NetworkInterface +from linode_api4 import ( + InstanceDiskEncryptionType, + InstancePlacementGroupAssignment, + NetworkInterface, +) from linode_api4.objects import ( Config, ConfigInterface, @@ -36,6 +40,10 @@ def test_get_linode(self): linode.host_uuid, "3a3ddd59d9a78bb8de041391075df44de62bfec8" ) self.assertEqual(linode.watchdog_enabled, True) + self.assertEqual( + linode.disk_encryption, InstanceDiskEncryptionType.disabled + ) + self.assertEqual(linode.lke_cluster_id, None) json = linode._raw_json self.assertIsNotNone(json) @@ -72,7 +80,10 @@ def test_rebuild(self): linode = Instance(self.client, 123) with self.mock_post("/linode/instances/123") as m: - pw = linode.rebuild("linode/debian9") + pw = linode.rebuild( + "linode/debian9", + disk_encryption=InstanceDiskEncryptionType.enabled, + ) self.assertIsNotNone(pw) self.assertTrue(isinstance(pw, str)) @@ -84,6 +95,7 @@ def test_rebuild(self): { "image": "linode/debian9", "root_pass": pw, + "disk_encryption": "enabled", }, ) @@ -306,6 +318,15 @@ def test_transfer_year_month(self): m.call_url, "/linode/instances/123/transfer/2023/4" ) + def test_lke_cluster(self): + """ + Tests that you can grab the parent LKE cluster from an instance node + """ + linode = Instance(self.client, 456) + + assert linode.lke_cluster_id == 18881 + assert linode.lke_cluster.id == linode.lke_cluster_id + def test_duplicate(self): """ Tests that you can submit a correct disk clone api request @@ -318,6 +339,8 @@ def test_duplicate(self): m.call_url, "/linode/instances/123/disks/12345/clone" ) + assert disk.disk_encryption == InstanceDiskEncryptionType.disabled + def test_disk_password(self): """ Tests that you can submit a correct disk password reset api request @@ -393,7 +416,6 @@ def test_create_disk(self): image="linode/debian10", ) self.assertEqual(m.call_url, "/linode/instances/123/disks") - print(m.call_data) self.assertEqual( m.call_data, { @@ -407,6 +429,7 @@ def test_create_disk(self): ) assert disk.id == 12345 + assert disk.disk_encryption == InstanceDiskEncryptionType.disabled def test_instance_create_with_user_data(self): """ diff --git a/test/unit/objects/lke_test.py b/test/unit/objects/lke_test.py index a44db97ef..f39fb84ae 100644 --- a/test/unit/objects/lke_test.py +++ b/test/unit/objects/lke_test.py @@ -1,6 +1,7 @@ from datetime import datetime from test.unit.base import ClientBaseCase +from linode_api4 import InstanceDiskEncryptionType from linode_api4.objects import ( LKECluster, LKEClusterControlPlaneACLAddressesOptions, @@ -47,6 +48,9 @@ def test_get_pool(self): self.assertEqual(pool.id, 456) self.assertEqual(pool.cluster_id, 18881) self.assertEqual(pool.type.id, "g6-standard-4") + self.assertEqual( + pool.disk_encryption, InstanceDiskEncryptionType.enabled + ) self.assertIsNotNone(pool.disks) self.assertIsNotNone(pool.nodes) self.assertIsNotNone(pool.autoscaler) @@ -84,7 +88,7 @@ def test_node_view(self): self.assertEqual(m.call_url, "/lke/clusters/18881/nodes/123456") self.assertIsNotNone(node) self.assertEqual(node.id, "123456") - self.assertEqual(node.instance_id, 123458) + self.assertEqual(node.instance_id, 456) self.assertEqual(node.status, "ready") def test_node_delete(self): From f8308035b109ceda59f0795872e04df6b2436553 Mon Sep 17 00:00:00 2001 From: Youjung Kim <126618609+ykim-1@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:12:53 -0700 Subject: [PATCH 2/7] add submodule checkout in release-cross-repo-test.yml (#438) --- .github/workflows/release-cross-repo-test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-cross-repo-test.yml b/.github/workflows/release-cross-repo-test.yml index 0850ed9ea..8708c3422 100644 --- a/.github/workflows/release-cross-repo-test.yml +++ b/.github/workflows/release-cross-repo-test.yml @@ -14,6 +14,9 @@ jobs: steps: - name: Checkout linode_api4 repository uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: 'recursive' - name: update packages run: sudo apt-get update -y @@ -26,11 +29,13 @@ jobs: with: python-version: '3.10' - - name: checkout repo - uses: actions/checkout@v3 + - name: Checkout ansible repo + uses: actions/checkout@v4 with: repository: linode/ansible_linode path: .ansible/collections/ansible_collections/linode/cloud + fetch-depth: 0 + submodules: 'recursive' - name: install dependencies run: | From 35b4ae04b348a90f8df3dffc6b5b12d1348f92ac Mon Sep 17 00:00:00 2001 From: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:58:43 -0400 Subject: [PATCH 3/7] PG affinity_type, is_strict -> placement_group_type, placement_group_policy (#437) --- linode_api4/groups/placement.py | 22 +++++++++++++--------- linode_api4/objects/placement.py | 18 +++++++++++++----- test/fixtures/linode_instances.json | 4 ++-- test/fixtures/placement_groups.json | 4 ++-- test/fixtures/placement_groups_123.json | 4 ++-- test/integration/conftest.py | 5 +++-- test/unit/objects/linode_test.py | 4 ++-- test/unit/objects/placement_test.py | 17 +++++++++-------- 8 files changed, 46 insertions(+), 32 deletions(-) diff --git a/linode_api4/groups/placement.py b/linode_api4/groups/placement.py index 90456fd17..e56970346 100644 --- a/linode_api4/groups/placement.py +++ b/linode_api4/groups/placement.py @@ -2,7 +2,11 @@ from linode_api4.errors import UnexpectedResponseError from linode_api4.groups import Group -from linode_api4.objects.placement import PlacementGroup +from linode_api4.objects.placement import ( + PlacementGroup, + PlacementGroupPolicy, + PlacementGroupType, +) from linode_api4.objects.region import Region @@ -31,8 +35,8 @@ def group_create( self, label: str, region: Union[Region, str], - affinity_type: str, - is_strict: bool = False, + placement_group_type: PlacementGroupType, + placement_group_policy: PlacementGroupPolicy, **kwargs, ) -> PlacementGroup: """ @@ -44,10 +48,10 @@ def group_create( :type label: str :param region: The region where the placement group will be created. Can be either a Region object or a string representing the region ID. :type region: Union[Region, str] - :param affinity_type: The affinity type of the placement group. - :type affinity_type: PlacementGroupAffinityType - :param is_strict: Whether the placement group is strict (defaults to False). - :type is_strict: bool + :param placement_group_type: The type of the placement group. + :type placement_group_type: PlacementGroupType + :param placement_group_policy: The policy for assignments to this placement group. + :type placement_group_policy: PlacementGroupPolicy :returns: The new Placement Group. :rtype: PlacementGroup @@ -55,8 +59,8 @@ def group_create( params = { "label": label, "region": region.id if isinstance(region, Region) else region, - "affinity_type": affinity_type, - "is_strict": is_strict, + "placement_group_type": placement_group_type, + "placement_group_policy": placement_group_policy, } params.update(kwargs) diff --git a/linode_api4/objects/placement.py b/linode_api4/objects/placement.py index eb5808eee..616c9061f 100644 --- a/linode_api4/objects/placement.py +++ b/linode_api4/objects/placement.py @@ -7,15 +7,23 @@ from linode_api4.objects.serializable import JSONObject, StrEnum -class PlacementGroupAffinityType(StrEnum): +class PlacementGroupType(StrEnum): """ - An enum class that represents the available affinity policies for Linodes - in a Placement Group. + An enum class that represents the available types of a Placement Group. """ anti_affinity_local = "anti_affinity:local" +class PlacementGroupPolicy(StrEnum): + """ + An enum class that represents the policy for Linode assignments to a Placement Group. + """ + + strict = "strict" + flexible = "flexible" + + @dataclass class PlacementGroupMember(JSONObject): """ @@ -42,9 +50,9 @@ class PlacementGroup(Base): "id": Property(identifier=True), "label": Property(mutable=True), "region": Property(slug_relationship=Region), - "affinity_type": Property(), + "placement_group_type": Property(), + "placement_group_policy": Property(), "is_compliant": Property(), - "is_strict": Property(), "members": Property(json_object=PlacementGroupMember), } diff --git a/test/fixtures/linode_instances.json b/test/fixtures/linode_instances.json index 651fc56c1..a991c1c4d 100644 --- a/test/fixtures/linode_instances.json +++ b/test/fixtures/linode_instances.json @@ -44,8 +44,8 @@ "placement_group": { "id": 123, "label": "test", - "affinity_type": "anti_affinity:local", - "is_strict": true + "placement_group_type": "anti_affinity:local", + "placement_group_policy": "strict" } }, { diff --git a/test/fixtures/placement_groups.json b/test/fixtures/placement_groups.json index f518e838d..758fc8521 100644 --- a/test/fixtures/placement_groups.json +++ b/test/fixtures/placement_groups.json @@ -4,8 +4,8 @@ "id": 123, "label": "test", "region": "eu-west", - "affinity_type": "anti_affinity:local", - "is_strict": true, + "placement_group_type": "anti_affinity:local", + "placement_group_policy": "strict", "is_compliant": true, "members": [ { diff --git a/test/fixtures/placement_groups_123.json b/test/fixtures/placement_groups_123.json index 5262bebe0..453e9fd5f 100644 --- a/test/fixtures/placement_groups_123.json +++ b/test/fixtures/placement_groups_123.json @@ -2,8 +2,8 @@ "id": 123, "label": "test", "region": "eu-west", - "affinity_type": "anti_affinity:local", - "is_strict": true, + "placement_group_type": "anti_affinity:local", + "placement_group_policy": "strict", "is_compliant": true, "members": [ { diff --git a/test/integration/conftest.py b/test/integration/conftest.py index 3638bd57d..9ef80e903 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -8,7 +8,7 @@ import requests from requests.exceptions import ConnectionError, RequestException -from linode_api4 import ApiError, PlacementGroupAffinityType +from linode_api4 import ApiError, PlacementGroupPolicy, PlacementGroupType from linode_api4.linode_client import LinodeClient from linode_api4.objects import Region @@ -465,7 +465,8 @@ def create_placement_group(test_linode_client): pg = client.placement.group_create( "pythonsdk-" + timestamp, get_region(test_linode_client, {"Placement Group"}), - PlacementGroupAffinityType.anti_affinity_local, + PlacementGroupType.anti_affinity_local, + PlacementGroupPolicy.flexible, ) yield pg diff --git a/test/unit/objects/linode_test.py b/test/unit/objects/linode_test.py index 8b03cbe7c..029392ab0 100644 --- a/test/unit/objects/linode_test.py +++ b/test/unit/objects/linode_test.py @@ -486,7 +486,7 @@ def test_get_placement_group(self): assert pg.id == 123 assert pg.label == "test" - assert pg.affinity_type == "anti_affinity:local" + assert pg.placement_group_type == "anti_affinity:local" # Invalidate the instance and try again # This makes sure the implicit refresh/cache logic works @@ -497,7 +497,7 @@ def test_get_placement_group(self): assert pg.id == 123 assert pg.label == "test" - assert pg.affinity_type == "anti_affinity:local" + assert pg.placement_group_type == "anti_affinity:local" def test_create_with_placement_group(self): """ diff --git a/test/unit/objects/placement_test.py b/test/unit/objects/placement_test.py index f3809d898..71d171644 100644 --- a/test/unit/objects/placement_test.py +++ b/test/unit/objects/placement_test.py @@ -1,9 +1,10 @@ from test.unit.base import ClientBaseCase +from linode_api4 import PlacementGroupPolicy from linode_api4.objects import ( PlacementGroup, - PlacementGroupAffinityType, PlacementGroupMember, + PlacementGroupType, ) @@ -42,8 +43,8 @@ def test_create_pg(self): pg = self.client.placement.group_create( "test", "eu-west", - PlacementGroupAffinityType.anti_affinity_local, - is_strict=True, + PlacementGroupType.anti_affinity_local, + PlacementGroupPolicy.strict, ) assert m.call_url == "/placement/groups" @@ -53,10 +54,10 @@ def test_create_pg(self): { "label": "test", "region": "eu-west", - "affinity_type": str( - PlacementGroupAffinityType.anti_affinity_local + "placement_group_type": str( + PlacementGroupType.anti_affinity_local ), - "is_strict": True, + "placement_group_policy": PlacementGroupPolicy.strict, }, ) @@ -109,8 +110,8 @@ def validate_pg_123(self, pg: PlacementGroup): assert pg.id == 123 assert pg.label == "test" assert pg.region.id == "eu-west" - assert pg.affinity_type == "anti_affinity:local" - assert pg.is_strict + assert pg.placement_group_type == "anti_affinity:local" + assert pg.placement_group_policy == "strict" assert pg.is_compliant assert pg.members[0] == PlacementGroupMember( linode_id=123, is_compliant=True From 8341dcea61514eadb2f0da51463e0bc4857251de Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:03:10 -0400 Subject: [PATCH 4/7] Add project label (#440) * Add project label * Update release.yml --- .github/labels.yml | 3 +++ .github/release.yml | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/labels.yml b/.github/labels.yml index 2a28fc812..83989042c 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -2,6 +2,9 @@ - name: new-feature description: for new features in the changelog. color: 225fee +- name: project + description: for new projects in the changelog. + color: 46BAF0 - name: improvement description: for improvements in existing functionality in the changelog. color: 22ee47 diff --git a/.github/release.yml b/.github/release.yml index 8417f9fb9..a2318fa64 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -3,7 +3,10 @@ changelog: labels: - ignore-for-release categories: - - title: ⚠️ Breaking Change + - title: 📋 New Project + labels: + - project + - title: ⚠️ Breaking Change labels: - breaking-change - title: 🐛 Bug Fixes @@ -18,7 +21,7 @@ changelog: - title: 🧪 Testing Improvements labels: - testing - - title: ⚙️ Repo/CI Improvements + - title: ⚙️ Repo/CI Improvements labels: - repo-ci-improvement - title: 📖 Documentation From 72481ad6046e993ab6e707e8caae15de58432f75 Mon Sep 17 00:00:00 2001 From: Jacob Riddle <87780794+jriddle-linode@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:15:32 -0400 Subject: [PATCH 5/7] Update api doc urls to point to techdocs (#439) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 📝 Description **What does this PR do and why is this change necessary?** Updates any api doc urls to point to https://techdocs.akamai.com/linode-api/reference/api --- README.rst | 2 +- docs/index.rst | 4 +- linode_api4/groups/account.py | 46 ++++++++--------- linode_api4/groups/beta.py | 2 +- linode_api4/groups/database.py | 14 +++--- linode_api4/groups/domain.py | 4 +- linode_api4/groups/image.py | 8 +-- linode_api4/groups/linode.py | 12 ++--- linode_api4/groups/lke.py | 6 +-- linode_api4/groups/longview.py | 6 +-- linode_api4/groups/networking.py | 22 ++++---- linode_api4/groups/nodebalancer.py | 4 +- linode_api4/groups/object_storage.py | 18 +++---- linode_api4/groups/polling.py | 6 +-- linode_api4/groups/profile.py | 24 ++++----- linode_api4/groups/region.py | 4 +- linode_api4/groups/support.py | 4 +- linode_api4/groups/tag.py | 4 +- linode_api4/groups/volume.py | 4 +- linode_api4/objects/account.py | 46 ++++++++--------- linode_api4/objects/beta.py | 2 +- linode_api4/objects/database.py | 36 +++++++------- linode_api4/objects/domain.py | 12 ++--- linode_api4/objects/image.py | 2 +- linode_api4/objects/linode.py | 72 +++++++++++++-------------- linode_api4/objects/lke.py | 30 +++++------ linode_api4/objects/longview.py | 6 +-- linode_api4/objects/networking.py | 16 +++--- linode_api4/objects/nodebalancer.py | 16 +++--- linode_api4/objects/object_storage.py | 24 ++++----- linode_api4/objects/profile.py | 20 ++++---- linode_api4/objects/region.py | 4 +- linode_api4/objects/support.py | 10 ++-- linode_api4/objects/tag.py | 4 +- linode_api4/objects/volume.py | 10 ++-- pyproject.toml | 2 +- 36 files changed, 253 insertions(+), 253 deletions(-) diff --git a/README.rst b/README.rst index bbbfeb31a..1e6b310f4 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ linode_api4 The official python library for the `Linode API v4`_ in python. -.. _Linode API v4: https://developers.linode.com/api/v4/ +.. _Linode API v4: https://techdocs.akamai.com/linode-api/reference/api .. image:: https://img.shields.io/github/actions/workflow/status/linode/linode_api4-python/main.yml?label=tests :target: https://img.shields.io/github/actions/workflow/status/linode/linode_api4-python/main.yml?label=tests diff --git a/docs/index.rst b/docs/index.rst index 828e7e751..1faf5dfa8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,11 +2,11 @@ linode_api4 =========== This is the documentation for the official Python bindings of the Linode -API v4. For API documentation, see `developers.linode.com`_. +API v4. For API documentation, see `techdocs.akamai.com`_. This library can be used to interact with all features of the Linode API. -.. _developers.linode.com: https://developers.linode.com/api/v4 +.. _techdocs.akamai.com: https://techdocs.akamai.com/linode-api/reference/api Installation ------------ diff --git a/linode_api4/groups/account.py b/linode_api4/groups/account.py index 21540ea7f..88f53ed09 100644 --- a/linode_api4/groups/account.py +++ b/linode_api4/groups/account.py @@ -34,7 +34,7 @@ def __call__(self): account = client.account() - API Documentation: https://www.linode.com/docs/api/account/#account-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-account :returns: Returns the acting user's account information. :rtype: Account @@ -52,7 +52,7 @@ def events(self, *filters): """ Lists events on the current account matching the given filters. - API Documentation: https://www.linode.com/docs/api/account/#events-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-events :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -69,7 +69,7 @@ def events_mark_seen(self, event): Marks event as the last event we have seen. If event is an int, it is treated as an event_id, otherwise it should be an event object whose id will be used. - API Documentation: https://www.linode.com/docs/api/account/#event-mark-as-seen + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-event-seen :param event: The Linode event to mark as seen. :type event: Event or int @@ -85,7 +85,7 @@ def settings(self): Returns the account settings data for this acocunt. This is not a listing endpoint. - API Documentation: https://www.linode.com/docs/api/account/#account-settings-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-account-settings :returns: The account settings data for this account. :rtype: AccountSettings @@ -105,7 +105,7 @@ def invoices(self): """ Returns Invoices issued to this account. - API Documentation: https://www.linode.com/docs/api/account/#invoices-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-invoices :param filters: Any number of filters to apply to this query. @@ -118,7 +118,7 @@ def payments(self): """ Returns a list of Payments made on this account. - API Documentation: https://www.linode.com/docs/api/account/#payments-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-payments :returns: A list of payments made on this account. :rtype: PaginatedList of Payment @@ -129,7 +129,7 @@ def oauth_clients(self, *filters): """ Returns the OAuth Clients associated with this account. - API Documentation: https://www.linode.com/docs/api/account/#oauth-clients-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-clients :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -144,7 +144,7 @@ def oauth_client_create(self, name, redirect_uri, **kwargs): """ Creates a new OAuth client. - API Documentation: https://www.linode.com/docs/api/account/#oauth-client-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-client :param name: The name of this application. :type name: str @@ -174,7 +174,7 @@ def users(self, *filters): """ Returns a list of users on this account. - API Documentation: https://www.linode.com/docs/api/account/#users-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-users :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -189,7 +189,7 @@ def logins(self): """ Returns a collection of successful logins for all users on the account during the last 90 days. - API Documentation: https://www.linode.com/docs/api/account/#user-logins-list-all + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-account-logins :returns: A list of Logins on this account. :rtype: PaginatedList of Login @@ -201,7 +201,7 @@ def maintenance(self): """ Returns a collection of Maintenance objects for any entity a user has permissions to view. Cancelled Maintenance objects are not returned. - API Documentation: https://www.linode.com/docs/api/account/#user-logins-list-all + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-account-logins :returns: A list of Maintenance objects on this account. :rtype: List of Maintenance objects as MappedObjects @@ -217,7 +217,7 @@ def payment_methods(self): """ Returns a list of Payment Methods for this Account. - API Documentation: https://www.linode.com/docs/api/account/#payment-methods-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-payment-methods :returns: A list of Payment Methods on this account. :rtype: PaginatedList of PaymentMethod @@ -229,7 +229,7 @@ def add_payment_method(self, data, is_default, type): """ Adds a Payment Method to your Account with the option to set it as the default method. - API Documentation: https://www.linode.com/docs/api/account/#payment-method-add + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-payment-method :param data: An object representing the credit card information you have on file with Linode to make Payments against your Account. @@ -281,7 +281,7 @@ def notifications(self): """ Returns a collection of Notification objects representing important, often time-sensitive items related to your Account. - API Documentation: https://www.linode.com/docs/api/account/#notifications-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-notifications :returns: A list of Notifications on this account. :rtype: List of Notification objects as MappedObjects @@ -297,7 +297,7 @@ def linode_managed_enable(self): """ Enables Linode Managed for the entire account and sends a welcome email to the account’s associated email address. - API Documentation: https://www.linode.com/docs/api/account/#linode-managed-enable + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-enable-account-managed """ resp = self.client.post( @@ -315,7 +315,7 @@ def add_promo_code(self, promo_code): """ Adds an expiring Promo Credit to your account. - API Documentation: https://www.linode.com/docs/api/account/#promo-credit-add + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-promo-credit :param promo_code: The Promo Code. :type promo_code: str @@ -341,7 +341,7 @@ def service_transfers(self): """ Returns a collection of all created and accepted Service Transfers for this account, regardless of the user that created or accepted the transfer. - API Documentation: https://www.linode.com/docs/api/account/#service-transfers-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-service-transfers :returns: A list of Service Transfers on this account. :rtype: PaginatedList of ServiceTransfer @@ -353,7 +353,7 @@ def service_transfer_create(self, entities): """ Creates a transfer request for the specified services. - API Documentation: https://www.linode.com/docs/api/account/#service-transfer-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-service-transfer :param entities: A collection of the services to include in this transfer request, separated by type. :type entities: dict @@ -396,7 +396,7 @@ def transfer(self): """ Returns a MappedObject containing the account's transfer pool data. - API Documentation: https://www.linode.com/docs/api/account/#network-utilization-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-transfer :returns: Information about this account's transfer pool data. :rtype: MappedObject @@ -421,7 +421,7 @@ def user_create(self, email, username, restricted=True): The new user will receive an email inviting them to set up their password. This must be completed before they can log in. - API Documentation: https://www.linode.com/docs/api/account/#user-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-user :param email: The new user's email address. This is used to finish setting up their user account. @@ -459,7 +459,7 @@ def enrolled_betas(self, *filters): """ Returns a list of all Beta Programs an account is enrolled in. - API doc: https://www.linode.com/docs/api/beta-programs/#enrolled-beta-programs-list + API doc: https://techdocs.akamai.com/linode-api/reference/get-enrolled-beta-programs :returns: a list of Beta Programs. :rtype: PaginatedList of AccountBetaProgram @@ -470,7 +470,7 @@ def join_beta_program(self, beta: Union[str, BetaProgram]): """ Enrolls an account into a beta program. - API doc: https://www.linode.com/docs/api/beta-programs/#beta-program-enroll + API doc: https://techdocs.akamai.com/linode-api/reference/post-beta-program :param beta: The object or id of a beta program to join. :type beta: BetaProgram or str @@ -491,7 +491,7 @@ def availabilities(self, *filters): Returns a list of all available regions and the resource types which are available to the account. - API doc: https://www.linode.com/docs/api/account/#region-service-availability + API doc: https://techdocs.akamai.com/linode-api/reference/get-account-availability :returns: a list of region availability information. :rtype: PaginatedList of AccountAvailability diff --git a/linode_api4/groups/beta.py b/linode_api4/groups/beta.py index 1da34ee25..a44fd492d 100644 --- a/linode_api4/groups/beta.py +++ b/linode_api4/groups/beta.py @@ -12,7 +12,7 @@ def betas(self, *filters): """ Returns a list of available active Beta Programs. - API Documentation: https://www.linode.com/docs/api/beta-programs/#beta-programs-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-beta-programs :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` diff --git a/linode_api4/groups/database.py b/linode_api4/groups/database.py index 8bddd47d0..957c136cf 100644 --- a/linode_api4/groups/database.py +++ b/linode_api4/groups/database.py @@ -31,7 +31,7 @@ def types(self, *filters): database_types = client.database.types(DatabaseType.deprecated == False) - API Documentation: https://www.linode.com/docs/api/databases/#managed-database-types-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-types :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -51,7 +51,7 @@ def engines(self, *filters): mysql_engines = client.database.engines(DatabaseEngine.engine == 'mysql') - API Documentation: https://www.linode.com/docs/api/databases/#managed-database-engines-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-engines :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -66,7 +66,7 @@ def instances(self, *filters): """ Returns a list of Managed Databases active on this account. - API Documentation: https://www.linode.com/docs/api/databases/#managed-databases-list-all + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-instances :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -81,7 +81,7 @@ def mysql_instances(self, *filters): """ Returns a list of Managed MySQL Databases active on this account. - API Documentation: https://www.linode.com/docs/api/databases/#managed-mysql-databases-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-mysql-instances :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -112,7 +112,7 @@ def mysql_create(self, label, region, engine, ltype, **kwargs): type.id ) - API Documentation: https://www.linode.com/docs/api/databases/#managed-mysql-database-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-mysql-instances :param label: The name for this cluster :type label: str @@ -146,7 +146,7 @@ def postgresql_instances(self, *filters): """ Returns a list of Managed PostgreSQL Databases active on this account. - API Documentation: https://www.linode.com/docs/api/databases/#managed-postgresql-databases-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-postgre-sql-instances :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -177,7 +177,7 @@ def postgresql_create(self, label, region, engine, ltype, **kwargs): type.id ) - API Documentation: https://www.linode.com/docs/api/databases/#managed-postgresql-database-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instances :param label: The name for this cluster :type label: str diff --git a/linode_api4/groups/domain.py b/linode_api4/groups/domain.py index c3b11146d..95bd3c838 100644 --- a/linode_api4/groups/domain.py +++ b/linode_api4/groups/domain.py @@ -13,7 +13,7 @@ def __call__(self, *filters): domains = client.domains() - API Documentation: https://www.linode.com/docs/api/domains/#domains-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-domains :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -30,7 +30,7 @@ def create(self, domain, master=True, **kwargs): your registrar to Linode's nameservers so that Linode's DNS manager will correctly serve your domain. - API Documentation: https://www.linode.com/docs/api/domains/#domain-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-domain :param domain: The domain to register to Linode's DNS manager. :type domain: str diff --git a/linode_api4/groups/image.py b/linode_api4/groups/image.py index e19928d7a..d22363af3 100644 --- a/linode_api4/groups/image.py +++ b/linode_api4/groups/image.py @@ -18,7 +18,7 @@ def __call__(self, *filters): debian_images = client.images( Image.vendor == "debain") - API Documentation: https://www.linode.com/docs/api/images/#images-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-images :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -33,7 +33,7 @@ def create(self, disk, label=None, description=None, cloud_init=False): """ Creates a new Image from a disk you own. - API Documentation: https://www.linode.com/docs/api/images/#image-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-image :param disk: The Disk to imagize. :type disk: Disk or int @@ -82,7 +82,7 @@ def create_upload( """ Creates a new Image and returns the corresponding upload URL. - API Documentation: https://www.linode.com/docs/api/images/#image-upload + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-upload-image :param label: The label of the Image to create. :type label: str @@ -119,7 +119,7 @@ def upload( """ Creates and uploads a new image. - API Documentation: https://www.linode.com/docs/api/images/#image-upload + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-upload-image :param label: The label of the Image to create. :type label: str diff --git a/linode_api4/groups/linode.py b/linode_api4/groups/linode.py index 5f69d2b94..5601c855c 100644 --- a/linode_api4/groups/linode.py +++ b/linode_api4/groups/linode.py @@ -40,7 +40,7 @@ def types(self, *filters): standard_types = client.linode.types(Type.class == "standard") - API documentation: https://www.linode.com/docs/api/linode-types/#types-list + API documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-types :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -58,7 +58,7 @@ def instances(self, *filters): prod_linodes = client.linode.instances(Instance.group == "prod") - API Documentation: https://www.linode.com/docs/api/linode-instances/#linodes-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-instances :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -78,7 +78,7 @@ def stackscripts(self, *filters, **kwargs): my_stackscripts = client.linode.stackscripts(mine_only=True) - API Documentation: https://www.linode.com/docs/api/stackscripts/#stackscripts-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-stack-scripts :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -115,7 +115,7 @@ def kernels(self, *filters): Returns a list of available :any:`Kernels`. Kernels are used when creating or updating :any:`LinodeConfigs,LinodeConfig>`. - API Documentation: https://www.linode.com/docs/api/linode-instances/#kernels-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-kernels :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -216,7 +216,7 @@ def instance_create( successfully until disks and configs are created, or it is otherwise configured. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-linode-instance :param ltype: The Instance Type we are creating :type ltype: str or Type @@ -384,7 +384,7 @@ def stackscript_create( """ Creates a new :any:`StackScript` on your account. - API Documentation: https://www.linode.com/docs/api/stackscripts/#stackscript-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-add-stack-script :param label: The label for this StackScript. :type label: str diff --git a/linode_api4/groups/lke.py b/linode_api4/groups/lke.py index 0e2785939..175a730ca 100644 --- a/linode_api4/groups/lke.py +++ b/linode_api4/groups/lke.py @@ -29,7 +29,7 @@ def versions(self, *filters): Returns a :any:`PaginatedList` of :any:`KubeVersion` objects that can be used when creating an LKE Cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubernetes-versions-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-lke-versions :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -45,7 +45,7 @@ def clusters(self, *filters): Returns a :any:`PaginagtedList` of :any:`LKECluster` objects that belong to this account. - https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubernetes-clusters-list + https://techdocs.akamai.com/linode-api/reference/get-lke-clusters :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -87,7 +87,7 @@ def cluster_create( kube_version ) - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubernetes-cluster-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-lke-cluster :param region: The Region to create this LKE Cluster in. :type region: Region or str diff --git a/linode_api4/groups/longview.py b/linode_api4/groups/longview.py index 8caf39962..3f2b292e3 100644 --- a/linode_api4/groups/longview.py +++ b/linode_api4/groups/longview.py @@ -17,7 +17,7 @@ def clients(self, *filters): Requests and returns a paginated list of LongviewClients on your account. - API Documentation: https://www.linode.com/docs/api/longview/#longview-clients-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-longview-clients :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -32,7 +32,7 @@ def client_create(self, label=None): """ Creates a new LongviewClient, optionally with a given label. - API Documentation: https://www.linode.com/docs/api/longview/#longview-client-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-longview-client :param label: The label for the new client. If None, a default label based on the new client's ID will be used. @@ -58,7 +58,7 @@ def subscriptions(self, *filters): """ Requests and returns a paginated list of LongviewSubscriptions available - API Documentation: https://www.linode.com/docs/api/longview/#longview-subscriptions-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-longview-subscriptions :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` diff --git a/linode_api4/groups/networking.py b/linode_api4/groups/networking.py index 606435422..7ba6919e4 100644 --- a/linode_api4/groups/networking.py +++ b/linode_api4/groups/networking.py @@ -21,7 +21,7 @@ def firewalls(self, *filters): """ Retrieves the Firewalls your user has access to. - API Documentation: https://www.linode.com/docs/api/networking/#firewalls-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-firewalls :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -37,7 +37,7 @@ def firewall_create(self, label, rules, **kwargs): Creates a new Firewall, either in the given Region or attached to the given Instance. - API Documentation: https://www.linode.com/docs/api/networking/#firewall-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-firewalls :param label: The label for the new Firewall. :type label: str @@ -74,7 +74,7 @@ def firewall_create(self, label, rules, **kwargs): firewall = client.networking.firewall_create('my-firewall', rules) - .. _Firewalls Documentation: https://www.linode.com/docs/api/networking/#firewall-create__request-body-schema + .. _Firewalls Documentation: https://techdocs.akamai.com/linode-api/reference/post-firewalls """ params = { @@ -97,7 +97,7 @@ def ips(self, *filters): """ Returns a list of IP addresses on this account, excluding private addresses. - API Documentation: https://www.linode.com/docs/api/networking/#ip-addresses-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-ips :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -112,7 +112,7 @@ def ipv6_ranges(self, *filters): """ Returns a list of IPv6 ranges on this account. - API Documentation: https://www.linode.com/docs/api/networking/#ipv6-ranges-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-ipv6-ranges :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -127,7 +127,7 @@ def ipv6_pools(self, *filters): """ Returns a list of IPv6 pools on this account. - API Documentation: https://www.linode.com/docs/api/networking/#ipv6-pools-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-ipv6-pools :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -145,7 +145,7 @@ def vlans(self, *filters): Returns a list of VLANs on your account. - API Documentation: https://www.linode.com/docs/api/networking/#vlans-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-vlans :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -184,7 +184,7 @@ def ips_assign(self, region, *assignments): linode1.invalidate() linode2.invalidate() - API Documentation: https://www.linode.com/docs/api/networking/#linodes-assign-ipv4s + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-assign-ipv4s :param region: The Region in which the assignments should take place. All Instances and IPAddresses involved in the assignment @@ -216,7 +216,7 @@ def ip_allocate(self, linode, public=True): Allocates an IP to a Instance you own. Additional IPs must be requested by opening a support ticket first. - API Documentation: https://www.linode.com/docs/api/networking/#ip-address-allocate + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-allocate-ip :param linode: The Instance to allocate the new IP for. :type linode: Instance or int @@ -249,7 +249,7 @@ def ips_share(self, linode, *ips): :any:`Instance`. This will enable the provided Instance to bring up the shared IP Addresses even though it does not own them. - API Documentation: https://www.linode.com/docs/api/networking/#ipv4-sharing-configure + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-share-ipv4s :param linode: The Instance to share the IPAddresses with. This Instance will be able to bring up the given addresses. @@ -289,7 +289,7 @@ def ip_addresses_share(self, ips, linode): primary Linode becomes unresponsive. This means that requests to the primary Linode’s IP address can be automatically rerouted to secondary Linodes at the configured shared IP addresses. - API Documentation: https://www.linode.com/docs/api/networking/#ip-addresses-share + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-share-ips :param linode: The id of the Instance or the Instance to share the IPAddresses with. This Instance will be able to bring up the given addresses. diff --git a/linode_api4/groups/nodebalancer.py b/linode_api4/groups/nodebalancer.py index 1430ad6a6..50068f8eb 100644 --- a/linode_api4/groups/nodebalancer.py +++ b/linode_api4/groups/nodebalancer.py @@ -13,7 +13,7 @@ def __call__(self, *filters): nodebalancers = client.nodebalancers() - API Documentation: https://www.linode.com/docs/api/nodebalancers/#nodebalancers-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-node-balancers :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -28,7 +28,7 @@ def create(self, region, **kwargs): """ Creates a new NodeBalancer in the given Region. - API Documentation: https://www.linode.com/docs/api/nodebalancers/#nodebalancer-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-node-balancer :param region: The Region in which to create the NodeBalancer. :type region: Region or str diff --git a/linode_api4/groups/object_storage.py b/linode_api4/groups/object_storage.py index c42805ec1..f531932e0 100644 --- a/linode_api4/groups/object_storage.py +++ b/linode_api4/groups/object_storage.py @@ -38,7 +38,7 @@ def clusters(self, *filters): us_east_clusters = client.object_storage.clusters(ObjectStorageCluster.region == "us-east") - API Documentation: https://www.linode.com/docs/api/object-storage/#clusters-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-clusters :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -54,7 +54,7 @@ def keys(self, *filters): Returns a list of Object Storage Keys active on this account. These keys allow third-party applications to interact directly with Linode Object Storage. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-keys-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-keys :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -105,7 +105,7 @@ def keys_create( bucket_access=client.object_storage.bucket_access("us-east-1", "example2", "read_only"), ) - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-key-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-object-storage-keys :param label: The label for this keypair, for identification only. :type label: str @@ -220,7 +220,7 @@ def buckets_in_region(self, region: str, *filters): This endpoint is available for convenience. It is recommended that instead you use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-buckets-in-cluster-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-bucketin-cluster :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -245,7 +245,7 @@ def cancel(self): cancelled, you will no longer receive the transfer for or be billed for Object Storage, and all keys will be invalidated. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-cancel + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-cancel-object-storage """ self.client.post("/object-storage/cancel", data={}) return True @@ -256,7 +256,7 @@ def transfer(self): in bytes, for the current month’s billing cycle. Object Storage adds 1 terabyte of outbound data transfer to your data transfer pool. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-transfer-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-transfer :returns: The amount of outbound data transfer used by your account’s Object Storage buckets, in bytes, for the current month’s billing cycle. @@ -278,7 +278,7 @@ def buckets(self, *filters): This endpoint is available for convenience. It is recommended that instead you use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-buckets-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-buckets :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -309,7 +309,7 @@ def bucket_create( This endpoint is available for convenience. It is recommended that instead you use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-object-storage-bucket :param acl: The Access Control Level of the bucket using a canned ACL string. For more fine-grained control of ACLs, use the S3 API directly. @@ -401,7 +401,7 @@ def object_url_create( This endpoint is available for convenience. It is recommended that instead you use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-object-url-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-object-storage-object-url :param cluster_or_region_id: The ID of the cluster or region this bucket exists in. :type cluster_or_region_id: str diff --git a/linode_api4/groups/polling.py b/linode_api4/groups/polling.py index 4141b78b9..7dff2d3d5 100644 --- a/linode_api4/groups/polling.py +++ b/linode_api4/groups/polling.py @@ -19,10 +19,10 @@ def event_poller_create( Creates a new instance of the EventPoller class. :param entity_type: The type of the entity to poll for events on. - Valid values for this field can be found here: https://www.linode.com/docs/api/account/#events-list__responses + Valid values for this field can be found here: https://techdocs.akamai.com/linode-api/reference/get-events :type entity_type: str :param action: The action that caused the Event to poll for. - Valid values for this field can be found here: https://www.linode.com/docs/api/account/#events-list__responses + Valid values for this field can be found here: https://techdocs.akamai.com/linode-api/reference/get-events :type action: str :param entity_id: The ID of the entity to poll for. :type entity_id: int @@ -51,7 +51,7 @@ def wait_for_entity_free( Waits for all events relevant events to not be scheduled or in-progress. :param entity_type: The type of the entity to poll for events on. - Valid values for this field can be found here: https://www.linode.com/docs/api/account/#events-list__responses + Valid values for this field can be found here: https://techdocs.akamai.com/linode-api/reference/get-events :type entity_type: str :param entity_id: The ID of the entity to poll for. :type entity_id: int diff --git a/linode_api4/groups/profile.py b/linode_api4/groups/profile.py index 8618ed3fd..4c49a2b5a 100644 --- a/linode_api4/groups/profile.py +++ b/linode_api4/groups/profile.py @@ -28,7 +28,7 @@ def __call__(self): profile = client.profile() - API Documentation: https://www.linode.com/docs/api/profile/#profile-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-profile :returns: The acting user's profile. :rtype: Profile @@ -47,7 +47,7 @@ def trusted_devices(self): """ Returns the Trusted Devices on your profile. - API Documentation: https://www.linode.com/docs/api/profile/#trusted-devices-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-devices :returns: A list of Trusted Devices for this profile. :rtype: PaginatedList of TrustedDevice @@ -69,7 +69,7 @@ def security_questions(self): """ Returns a collection of security questions and their responses, if any, for your User Profile. - API Documentation: https://www.linode.com/docs/api/profile/#security-questions-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-security-questions """ result = self.client.get( @@ -120,7 +120,7 @@ def phone_number_delete(self): """ Delete the verified phone number for the User making this request. - API Documentation: https://www.linode.com/docs/api/profile/#phone-number-delete + API Documentation: https://techdocs.akamai.com/linode-api/reference/delete-profile-phone-number :returns: Returns True if the operation was successful. :rtype: bool @@ -143,7 +143,7 @@ def phone_number_verify(self, otp_code): Verify a phone number by confirming the one-time code received via SMS message after accessing the Phone Verification Code Send (POST /profile/phone-number) command. - API Documentation: https://www.linode.com/docs/api/profile/#phone-number-verify + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-profile-phone-number-verify :param otp_code: The one-time code received via SMS message after accessing the Phone Verification Code Send :type otp_code: str @@ -175,7 +175,7 @@ def phone_number_verification_code_send(self, iso_code, phone_number): """ Send a one-time verification code via SMS message to the submitted phone number. - API Documentation: https://www.linode.com/docs/api/profile/#phone-number-verification-code-send + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-profile-phone-number :param iso_code: The two-letter ISO 3166 country code associated with the phone number. :type iso_code: str @@ -213,7 +213,7 @@ def logins(self): """ Returns the logins on your profile. - API Documentation: https://www.linode.com/docs/api/profile/#logins-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-profile-logins :returns: A list of logins for this profile. :rtype: PaginatedList of ProfileLogin @@ -224,7 +224,7 @@ def tokens(self, *filters): """ Returns the Person Access Tokens active for this user. - API Documentation: https://www.linode.com/docs/api/profile/#personal-access-tokens-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-personal-access-tokens :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -239,7 +239,7 @@ def token_create(self, label=None, expiry=None, scopes=None, **kwargs): """ Creates and returns a new Personal Access Token. - API Documentation: https://www.linode.com/docs/api/profile/#personal-access-token-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-personal-access-token :param label: The label of the new Personal Access Token. :type label: str @@ -275,7 +275,7 @@ def apps(self, *filters): """ Returns the Authorized Applications for this user - API Documentation: https://www.linode.com/docs/api/profile/#authorized-apps-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-profile-apps :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -290,7 +290,7 @@ def ssh_keys(self, *filters): """ Returns the SSH Public Keys uploaded to your profile. - API Documentation: https://www.linode.com/docs/api/profile/#ssh-keys-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-ssh-keys :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -306,7 +306,7 @@ def ssh_key_upload(self, key, label): Uploads a new SSH Public Key to your profile This key can be used in later Linode deployments. - API Documentation: https://www.linode.com/docs/api/profile/#ssh-key-add + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-add-ssh-key :param key: The ssh key, or a path to the ssh key. If a path is provided, the file at the path must exist and be readable or an exception diff --git a/linode_api4/groups/region.py b/linode_api4/groups/region.py index 9ddc8fb63..baf8697e4 100644 --- a/linode_api4/groups/region.py +++ b/linode_api4/groups/region.py @@ -13,7 +13,7 @@ def __call__(self, *filters): region = client.regions() - API Documentation: https://www.linode.com/docs/api/regions/#regions-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-regions :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -30,7 +30,7 @@ def availability(self, *filters): Returns the availability of Linode plans within a Region. - API Documentation: https://www.linode.com/docs/api/regions/#regions-availability-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-regions-availability :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` diff --git a/linode_api4/groups/support.py b/linode_api4/groups/support.py index 565128b2f..ccc0b154d 100644 --- a/linode_api4/groups/support.py +++ b/linode_api4/groups/support.py @@ -23,7 +23,7 @@ def tickets(self, *filters): """ Returns a list of support tickets on this account. - API Documentation: https://www.linode.com/docs/api/support/#support-tickets-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-tickets :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -46,7 +46,7 @@ def ticket_open( """ Opens a support ticket on this account. - API Documentation: https://www.linode.com/docs/api/support/#support-ticket-open + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-ticket :param summary: The summary or title for this support ticket. :type summary: str diff --git a/linode_api4/groups/tag.py b/linode_api4/groups/tag.py index ebf733159..5948b513b 100644 --- a/linode_api4/groups/tag.py +++ b/linode_api4/groups/tag.py @@ -14,7 +14,7 @@ def __call__(self, *filters): tags = client.tags() - API Documentation: https://www.linode.com/docs/api/domains/#domain-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-domain :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -37,7 +37,7 @@ def create( """ Creates a new Tag and optionally applies it to the given entities. - API Documentation: https://www.linode.com/docs/api/tags/#tags-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-tags :param label: The label for the new Tag :type label: str diff --git a/linode_api4/groups/volume.py b/linode_api4/groups/volume.py index b27ebf8ba..edbfdfbf8 100644 --- a/linode_api4/groups/volume.py +++ b/linode_api4/groups/volume.py @@ -13,7 +13,7 @@ def __call__(self, *filters): volumes = client.volumes() - API Documentation: https://www.linode.com/docs/api/volumes/#volumes-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-volumes :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -29,7 +29,7 @@ def create(self, label, region=None, linode=None, size=20, **kwargs): Creates a new Block Storage Volume, either in the given Region or attached to the given Instance. - API Documentation: https://www.linode.com/docs/api/volumes/#volumes-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-volumes :param label: The label for the new Volume. :type label: str diff --git a/linode_api4/objects/account.py b/linode_api4/objects/account.py index 8c5ad098f..31e3cf33d 100644 --- a/linode_api4/objects/account.py +++ b/linode_api4/objects/account.py @@ -26,7 +26,7 @@ class Account(Base): """ The contact and billing information related to your Account. - API Documentation: https://www.linode.com/docs/api/account/#account-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-account """ api_endpoint = "/account" @@ -93,7 +93,7 @@ class ServiceTransfer(Base): """ A transfer request for transferring a service between Linode accounts. - API Documentation: https://www.linode.com/docs/api/account/#service-transfer-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-service-transfer """ api_endpoint = "/account/service-transfers/{token}" @@ -112,7 +112,7 @@ def service_transfer_accept(self): """ Accept a Service Transfer for the provided token to receive the services included in the transfer to your account. - API Documentation: https://www.linode.com/docs/api/account/#service-transfer-accept + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-accept-service-transfer """ resp = self._client.post( @@ -131,7 +131,7 @@ class PaymentMethod(Base): """ A payment method to be used on this Linode account. - API Documentation: https://www.linode.com/docs/api/account/#payment-method-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-payment-method """ api_endpoint = "/account/payment-methods/{id}" @@ -147,7 +147,7 @@ def payment_method_make_default(self): """ Make this Payment Method the default method for automatically processing payments. - API Documentation: https://www.linode.com/docs/api/account/#payment-method-make-default + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-make-payment-method-default """ resp = self._client.post( @@ -166,7 +166,7 @@ class Login(Base): """ A login entry for this account. - API Documentation: https://www.linode.com/docs/api/account/#login-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-account-login """ api_endpoint = "/account/logins/{id}" @@ -184,7 +184,7 @@ class AccountSettings(Base): """ Information related to your Account settings. - API Documentation: https://www.linode.com/docs/api/account/#account-settings-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-account-settings """ api_endpoint = "/account/settings" @@ -205,7 +205,7 @@ class Event(Base): """ An event object representing an event that took place on this account. - API Documentation: https://www.linode.com/docs/api/account/#event-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-event """ api_endpoint = "/account/events/{id}" @@ -310,7 +310,7 @@ def mark_read(self): """ Marks a single Event as read. - API Documentation: https://www.linode.com/docs/api/account/#event-mark-as-read + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-event-read """ self._client.post("{}/read".format(Event.api_endpoint), model=self) @@ -319,7 +319,7 @@ def mark_seen(self): """ Marks a single Event as seen. - API Documentation: https://www.linode.com/docs/api/account/#event-mark-as-seen + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-event-seen """ self._client.post("{}/seen".format(Event.api_endpoint), model=self) @@ -329,7 +329,7 @@ class InvoiceItem(DerivedBase): """ An individual invoice item under an :any:`Invoice` object. - API Documentation: https://www.linode.com/docs/api/account/#invoice-items-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-invoice-items """ api_endpoint = "/account/invoices/{invoice_id}/items" @@ -364,7 +364,7 @@ class Invoice(Base): """ A single invoice on this Linode account. - API Documentation: https://www.linode.com/docs/api/account/#invoice-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-invoice """ api_endpoint = "/account/invoices/{id}" @@ -385,7 +385,7 @@ class OAuthClient(Base): """ An OAuthClient object that can be used to authenticate apps with this account. - API Documentation: https://www.linode.com/docs/api/account/#oauth-client-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-client """ api_endpoint = "/account/oauth-clients/{id}" @@ -404,7 +404,7 @@ def reset_secret(self): """ Resets the client secret for this client. - API Documentation: https://www.linode.com/docs/api/account/#oauth-client-secret-reset + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-reset-client-secret """ result = self._client.post( "{}/reset_secret".format(OAuthClient.api_endpoint), model=self @@ -424,7 +424,7 @@ def thumbnail(self, dump_to=None): If dump_to is given, attempts to write the image to a file at the given location. - API Documentation: https://www.linode.com/docs/api/account/#oauth-client-thumbnail-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-client-thumbnail """ headers = {"Authorization": "token {}".format(self._client.token)} @@ -452,7 +452,7 @@ def set_thumbnail(self, thumbnail): uploads it as a png. Otherwise, assumes thumbnail is a path to the thumbnail and reads it in as bytes before uploading. - API Documentation: https://www.linode.com/docs/api/account/#oauth-client-thumbnail-update + API Documentation: https://techdocs.akamai.com/linode-api/reference/put-client-thumbnail """ headers = { "Authorization": "token {}".format(self._client.token), @@ -487,7 +487,7 @@ class Payment(Base): """ An object representing a single payment on the current Linode Account. - API Documentation: https://www.linode.com/docs/api/account/#payment-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-payment """ api_endpoint = "/account/payments/{id}" @@ -503,7 +503,7 @@ class User(Base): """ An object representing a single user on this account. - API Documentation: https://www.linode.com/docs/api/account/#user-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-user """ api_endpoint = "/account/users/{id}" @@ -525,7 +525,7 @@ def grants(self): will result in an ApiError. This is smart, and will only fetch from the api once unless the object is invalidated. - API Documentation: https://www.linode.com/docs/api/account/#users-grants-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-user-grants :returns: The grants for this user. :rtype: linode.objects.account.UserGrants @@ -624,7 +624,7 @@ class UserGrants: a Base-like model (such as a unique, ID-based endpoint at which to access it), however it has some similarities so that its usage is familiar. - API Documentation: https://www.linode.com/docs/api/account/#users-grants-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-user-grants """ api_endpoint = "/account/users/{username}/grants" @@ -650,7 +650,7 @@ def save(self): """ Applies the grants to the parent user. - API Documentation: https://www.linode.com/docs/api/account/#users-grants-update + API Documentation: https://techdocs.akamai.com/linode-api/reference/put-user-grants """ req = { @@ -680,7 +680,7 @@ class AccountBetaProgram(Base): """ The details and enrollment information of a Beta program that an account is enrolled in. - API Documentation: https://www.linode.com/docs/api/beta-programs/#enrolled-beta-program-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-enrolled-beta-program """ api_endpoint = "/account/betas/{id}" @@ -700,7 +700,7 @@ class AccountAvailability(Base): Contains information about the resources available for a region under the current account. - API doc: https://www.linode.com/docs/api/account/#region-service-availability + API doc: https://techdocs.akamai.com/linode-api/reference/get-account-availability """ api_endpoint = "/account/availability/{region}" diff --git a/linode_api4/objects/beta.py b/linode_api4/objects/beta.py index 42a3eef85..c957aa584 100644 --- a/linode_api4/objects/beta.py +++ b/linode_api4/objects/beta.py @@ -6,7 +6,7 @@ class BetaProgram(Base): Beta program is a new product or service that's not generally available to all customers. User with permissions can enroll into a beta program and access the functionalities. - API Documentation: https://www.linode.com/docs/api/beta-programs/#beta-program-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-beta-program """ api_endpoint = "/betas/{id}" diff --git a/linode_api4/objects/database.py b/linode_api4/objects/database.py index f71115758..6a028722c 100644 --- a/linode_api4/objects/database.py +++ b/linode_api4/objects/database.py @@ -5,7 +5,7 @@ class DatabaseType(Base): """ The type of a managed database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-database-type-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-type """ api_endpoint = "/databases/types/{id}" @@ -40,7 +40,7 @@ class DatabaseEngine(Base): - MySQL - PostgreSQL - API Documentation: https://www.linode.com/docs/api/databases/#managed-database-engine-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-engine """ api_endpoint = "/databases/engines/{id}" @@ -88,8 +88,8 @@ def restore(self): API Documentation: - - MySQL: https://www.linode.com/docs/api/databases/#managed-mysql-database-backup-restore - - PostgreSQL: https://www.linode.com/docs/api/databases/#managed-postgresql-database-backup-restore + - MySQL: https://techdocs.akamai.com/linode-api/reference/post-databases-mysql-instance-backup-restore + - PostgreSQL: https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instance-backup-restore """ return self._client.post( @@ -101,7 +101,7 @@ class MySQLDatabaseBackup(DatabaseBackup): """ A backup for an accessible Managed MySQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-mysql-database-backup-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-mysql-instance-backup """ api_endpoint = "/databases/mysql/instances/{database_id}/backups/{id}" @@ -111,7 +111,7 @@ class PostgreSQLDatabaseBackup(DatabaseBackup): """ A backup for an accessible Managed PostgreSQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-postgresql-database-backup-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-postgresql-instance-backup """ api_endpoint = "/databases/postgresql/instances/{database_id}/backups/{id}" @@ -121,7 +121,7 @@ class MySQLDatabase(Base): """ An accessible Managed MySQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-mysql-database-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-mysql-instance """ api_endpoint = "/databases/mysql/instances/{id}" @@ -153,7 +153,7 @@ def credentials(self): Display the root username and password for an accessible Managed MySQL Database. The Database must have an active status to perform this command. - API Documentation: https://www.linode.com/docs/api/databases/#managed-mysql-database-credentials-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-mysql-instance-credentials :returns: MappedObject containing credntials for this DB :rtype: MappedObject @@ -172,7 +172,7 @@ def ssl(self): """ Display the SSL CA certificate for an accessible Managed MySQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-mysql-database-ssl-certificate-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-mysql-instance-ssl :returns: MappedObject containing SSL CA certificate for this DB :rtype: MappedObject @@ -190,7 +190,7 @@ def credentials_reset(self): """ Reset the root password for a Managed MySQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-mysql-database-credentials-reset + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-mysql-instance-credentials-reset :returns: Response from the API call to reset credentials :rtype: dict @@ -207,7 +207,7 @@ def patch(self): """ Apply security patches and updates to the underlying operating system of the Managed MySQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-mysql-database-patch + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-mysql-instance-patch :returns: Response from the API call to apply security patches :rtype: dict @@ -223,7 +223,7 @@ def backup_create(self, label, **kwargs): """ Creates a snapshot backup of a Managed MySQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-mysql-database-backup-snapshot-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-mysql-instance-backup """ params = { @@ -254,7 +254,7 @@ class PostgreSQLDatabase(Base): """ An accessible Managed PostgreSQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-postgresql-database-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-postgre-sql-instance """ api_endpoint = "/databases/postgresql/instances/{id}" @@ -287,7 +287,7 @@ def credentials(self): Display the root username and password for an accessible Managed PostgreSQL Database. The Database must have an active status to perform this command. - API Documentation: https://www.linode.com/docs/api/databases/#managed-postgresql-database-credentials-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-postgre-sql-instance-credentials :returns: MappedObject containing credntials for this DB :rtype: MappedObject @@ -307,7 +307,7 @@ def ssl(self): """ Display the SSL CA certificate for an accessible Managed PostgreSQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-postgresql-database-ssl-certificate-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-postgresql-instance-ssl :returns: MappedObject containing SSL CA certificate for this DB :rtype: MappedObject @@ -325,7 +325,7 @@ def credentials_reset(self): """ Reset the root password for a Managed PostgreSQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-postgresql-database-credentials-reset + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instance-credentials-reset :returns: Response from the API call to reset credentials :rtype: dict @@ -342,7 +342,7 @@ def patch(self): """ Apply security patches and updates to the underlying operating system of the Managed PostgreSQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-postgresql-database-patch + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instance-patch :returns: Response from the API call to apply security patches :rtype: dict @@ -358,7 +358,7 @@ def backup_create(self, label, **kwargs): """ Creates a snapshot backup of a Managed PostgreSQL Database. - API Documentation: https://www.linode.com/docs/api/databases/#managed-postgresql-database-backup-snapshot-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instance-backup """ params = { diff --git a/linode_api4/objects/domain.py b/linode_api4/objects/domain.py index aeca7d837..8ce7a5ee4 100644 --- a/linode_api4/objects/domain.py +++ b/linode_api4/objects/domain.py @@ -6,7 +6,7 @@ class DomainRecord(DerivedBase): """ A single record on a Domain. - API Documentation: https://www.linode.com/docs/api/domains/#domain-record-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-domain-record """ api_endpoint = "/domains/{domain_id}/records/{id}" @@ -37,7 +37,7 @@ class Domain(Base): Linode is not a registrar, and in order for this Domain record to work you must own the domain and point your registrar at Linode’s nameservers. - API Documentation: https://www.linode.com/docs/api/domains/#domain-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-domain """ api_endpoint = "/domains/{id}" @@ -64,7 +64,7 @@ def record_create(self, record_type, **kwargs): Adds a new Domain Record to the zonefile this Domain represents. Each domain can have up to 12,000 active records. - API Documentation: https://www.linode.com/docs/api/domains/#domain-record-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-domain-record :param record_type: The type of Record this is in the DNS system. Can be one of: A, AAAA, NS, MX, CNAME, TXT, SRV, PTR, CAA. @@ -101,7 +101,7 @@ def zone_file_view(self): """ Returns the zone file for the last rendered zone for the specified domain. - API Documentation: https://www.linode.com/docs/api/domains/#domain-zone-file-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-domain-zone :returns: The zone file for the last rendered zone for the specified domain in the form of a list of the lines of the zone file. @@ -118,7 +118,7 @@ def clone(self, domain: str): """ Clones a Domain and all associated DNS records from a Domain that is registered in Linode’s DNS manager. - API Documentation: https://www.linode.com/docs/api/domains/#domain-clone + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-clone-domain :param domain: The new domain for the clone. Domain labels cannot be longer than 63 characters and must conform to RFC1035. Domains must be @@ -143,7 +143,7 @@ def domain_import(self, domain, remote_nameserver): - 2600:3c00::5e = 2600:3c00::5f - API Documentation: https://www.linode.com/docs/api/domains/#domain-import + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-import-domain :param domain: The domain to import. :type: domain: str diff --git a/linode_api4/objects/image.py b/linode_api4/objects/image.py index a919d25e0..2317dd20d 100644 --- a/linode_api4/objects/image.py +++ b/linode_api4/objects/image.py @@ -5,7 +5,7 @@ class Image(Base): """ An Image is something a Linode Instance or Disk can be deployed from. - API Documentation: https://www.linode.com/docs/api/images/#image-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-image """ api_endpoint = "/images/{id}" diff --git a/linode_api4/objects/linode.py b/linode_api4/objects/linode.py index d86ec1746..1b102da37 100644 --- a/linode_api4/objects/linode.py +++ b/linode_api4/objects/linode.py @@ -32,7 +32,7 @@ class Backup(DerivedBase): """ A Backup of a Linode Instance. - API Documentation: https://www.linode.com/docs/api/linode-instances/#backup-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-backup """ api_endpoint = "/linode/instances/{linode_id}/backups/{id}" @@ -60,7 +60,7 @@ def restore_to(self, linode, **kwargs): """ Restores a Linode’s Backup to the specified Linode. - API Documentation: https://www.linode.com/docs/api/linode-instances/#backup-restore + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-restore-backup :param linode: The id of the Instance or the Instance to share the IPAddresses with. This Instance will be able to bring up the given addresses. @@ -98,7 +98,7 @@ class Disk(DerivedBase): """ A Disk for the storage space on a Compute Instance. - API Documentation: https://www.linode.com/docs/api/linode-instances/#disk-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-disk """ api_endpoint = "/linode/instances/{linode_id}/disks/{id}" @@ -121,7 +121,7 @@ def duplicate(self): Copies a disk, byte-for-byte, into a new Disk belonging to the same Linode. The Linode must have enough storage space available to accept a new Disk of the same size as this one or this operation will fail. - API Documentation: https://www.linode.com/docs/api/linode-instances/#disk-clone + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-clone-linode-disk :returns: A Disk object representing the cloned Disk :rtype: Disk @@ -140,7 +140,7 @@ def reset_root_password(self, root_password=None): """ Resets the password of a Disk you have permission to read_write. - API Documentation: https://www.linode.com/docs/api/linode-instances/#disk-root-password-reset + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-reset-disk-password :param root_password: The new root password for the OS installed on this Disk. The password must meet the complexity strength validation requirements for a strong password. @@ -168,7 +168,7 @@ def resize(self, new_size): fit on the new disk size. You may need to resize the filesystem on the disk first before performing this action. - API Documentation: https://www.linode.com/docs/api/linode-instances/#disk-resize + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-resize-disk :param new_size: The intended new size of the disk, in MB :type new_size: int @@ -208,7 +208,7 @@ class Kernel(Base): to compile the kernel from source than to download it from your package manager. For more information on custom compiled kernels, review our guides for Debian, Ubuntu, and CentOS. - API Documentation: https://www.linode.com/docs/api/linode-instances/#kernel-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-kernel """ api_endpoint = "/linode/kernels/{id}" @@ -232,7 +232,7 @@ class Type(Base): """ Linode Plan type to specify the resources available to a Linode Instance. - API Documentation: https://www.linode.com/docs/api/linode-types/#type-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-type """ api_endpoint = "/linode/types/{id}" @@ -416,7 +416,7 @@ class Config(DerivedBase): """ A Configuration Profile for a Linode Instance. - API Documentation: https://www.linode.com/docs/api/linode-instances/#configuration-profile-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-config """ api_endpoint = "/linode/instances/{linode_id}/configs/{id}" @@ -636,7 +636,7 @@ class Instance(Base): """ A Linode Instance. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-instance """ api_endpoint = "/linode/instances/{id}" @@ -670,7 +670,7 @@ def ips(self): The ips related collection is not normalized like the others, so we have to make an ad-hoc object to return for its response - API Documentation: https://www.linode.com/docs/api/linode-instances/#networking-information-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-ips :returns: A List of the ips of the Linode Instance. :rtype: List[IPAddress] @@ -751,7 +751,7 @@ def available_backups(self): """ The backups response contains what backups are available to be restored. - API Documentation: https://www.linode.com/docs/api/linode-instances/#backups-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-backups :returns: A List of the available backups for the Linode Instance. :rtype: List[Backup] @@ -809,7 +809,7 @@ def reset_instance_root_password(self, root_password=None): """ Resets the root password for this Linode. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-root-password-reset + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-reset-linode-password :param root_password: The root user’s password on this Linode. Linode passwords must meet a password strength score requirement that is calculated internally @@ -833,7 +833,7 @@ def transfer_year_month(self, year, month): """ Get per-linode transfer for specified month - API Documentation: https://www.linode.com/docs/api/linode-instances/#network-transfer-view-yearmonth + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-transfer-by-year-month :param year: Numeric value representing the year to look up. :type: year: int @@ -861,7 +861,7 @@ def transfer(self): """ Get per-linode transfer - API Documentation: https://www.linode.com/docs/api/linode-instances/#network-transfer-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-transfer :returns: The network transfer statistics for the current month. :rtype: MappedObject @@ -951,7 +951,7 @@ def boot(self, config=None): (because the Linode was never booted or the last booted config was deleted) an error will be returned. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-boot + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-boot-linode-instance :param config: The Linode Config ID to boot into. :type: config: int @@ -976,7 +976,7 @@ def shutdown(self): are currently running or queued, those actions must be completed first before you can initiate a shutdown. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-shut-down + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-shutdown-linode-instance :returns: True if the operation was successful. :rtype: bool @@ -995,7 +995,7 @@ def reboot(self): Reboots a Linode you have permission to modify. If any actions are currently running or queued, those actions must be completed first before you can initiate a reboot. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-reboot + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-reboot-linode-instance :returns: True if the operation was successful. :rtype: bool @@ -1027,7 +1027,7 @@ def resize( - The Linode must not have more disk allocation than the new Type allows. - In that situation, you must first delete or resize the disk to be smaller. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-resize + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-resize-linode-instance :param new_type: The Linode Type or the id representing it. :type: new_type: Type or int @@ -1096,7 +1096,7 @@ def config_create( """ Creates a Linode Config with the given attributes. - API Documentation: https://www.linode.com/docs/api/linode-instances/#configuration-profile-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-add-linode-config :param kernel: The kernel to boot with. :param label: The config label @@ -1211,7 +1211,7 @@ def disk_create( """ Creates a new Disk for this Instance. - API Documentation: https://www.linode.com/docs/api/linode-instances/#disk-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-add-linode-disk :param size: The size of the disk, in MB :param label: The label of the disk. If not given, a default label will be generated. @@ -1296,7 +1296,7 @@ def enable_backups(self): For more information on Instance's Backups service and pricing, see our Backups Page: https://www.linode.com/backups - API Documentation: https://www.linode.com/docs/api/linode-instances/#backups-enable + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-enable-backups :returns: True if the operation was successful. :rtype: bool @@ -1313,7 +1313,7 @@ def cancel_backups(self): including any snapshots that have been taken. This cannot be undone, but Backups can be re-enabled at a later date. - API Documentation: https://www.linode.com/docs/api/linode-instances/#backups-cancel + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-cancel-backups :returns: True if the operation was successful. :rtype: bool @@ -1331,7 +1331,7 @@ def snapshot(self, label=None): Important: If you already have a snapshot of this Linode, this is a destructive action. The previous snapshot will be deleted. - API Documentation: https://www.linode.com/docs/api/linode-instances/#snapshot-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-snapshot :param label: The label for the new snapshot. :type: label: str @@ -1365,7 +1365,7 @@ def ip_allocate(self, public=False): before you can add one. You may only have, at most, one private IP per Instance. - API Documentation: https://www.linode.com/docs/api/linode-instances/#ipv4-address-allocate + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-add-linode-ip :param public: If the new IP should be public or private. Defaults to private. @@ -1397,7 +1397,7 @@ def rebuild(self, image, root_pass=None, authorized_keys=None, **kwargs): a new :any:`Image` to it. This can be used to reset an existing Instance or to install an Image on an empty Instance. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-rebuild + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-rebuild-linode-instance :param image: The Image to deploy to this Instance :type image: str or Image @@ -1455,7 +1455,7 @@ def rescue(self, *disks): Note that “sdh” is reserved and unavailable during rescue. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-boot-into-rescue-mode + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-rescue-linode-instance :param disks: Devices that are either Disks or Volumes :type: disks: dict @@ -1495,7 +1495,7 @@ def mutate(self, allow_auto_disk_resize=True): """ Upgrades this Instance to the latest generation type - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-upgrade + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-mutate-linode-instance :param allow_auto_disk_resize: Automatically resize disks when resizing a Linode. When resizing down to a smaller plan your Linode’s @@ -1527,7 +1527,7 @@ def initiate_migration( Initiates a pending migration that is already scheduled for this Linode Instance - API Documentation: https://www.linode.com/docs/api/linode-instances/#dc-migrationpending-host-migration-initiate + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-migrate-linode-instance :param region: The region to which the Linode will be migrated. Must be a valid region slug. A list of regions can be viewed by using the GET /regions endpoint. A cross data @@ -1572,7 +1572,7 @@ def firewalls(self): """ View Firewall information for Firewalls associated with this Linode. - API Documentation: https://www.linode.com/docs/api/linode-instances/#firewalls-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-firewalls :returns: A List of Firewalls of the Linode Instance. :rtype: List[Firewall] @@ -1594,7 +1594,7 @@ def nodebalancers(self): """ View a list of NodeBalancers that are assigned to this Linode and readable by the requesting User. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-nodebalancers-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-node-balancers :returns: A List of Nodebalancers of the Linode Instance. :rtype: List[Nodebalancer] @@ -1616,7 +1616,7 @@ def volumes(self): """ View Block Storage Volumes attached to this Linode. - API Documentation: https://www.linode.com/docs/api/linode-instances/#linodes-volumes-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-volumes :returns: A List of Volumes of the Linode Instance. :rtype: List[Volume] @@ -1651,7 +1651,7 @@ def clone( """ Clones this linode into a new linode or into a new linode in the given region - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-clone + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-clone-linode-instance :param to_linode: If an existing Linode is the target for the clone, the ID of that Linode. The existing Linode must have enough resources to accept the clone. @@ -1745,7 +1745,7 @@ def stats(self): """ Returns the JSON stats for this Instance - API Documentation: https://www.linode.com/docs/api/linode-instances/#linode-statistics-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-stats :returns: The JSON stats for this Instance :rtype: dict @@ -1759,7 +1759,7 @@ def stats_for(self, dt): """ Returns stats for the month containing the given datetime - API Documentation: https://www.linode.com/docs/api/linode-instances/#statistics-view-yearmonth + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-stats-by-year-month :param dt: A Datetime for which to return statistics :type: dt: Datetime @@ -1803,7 +1803,7 @@ class StackScript(Base): A script allowing users to reproduce specific software configurations when deploying Compute Instances, with more user control than static system images. - API Documentation: https://www.linode.com/docs/api/stackscripts/#stackscript-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-stack-script """ api_endpoint = "/linode/stackscripts/{id}" diff --git a/linode_api4/objects/lke.py b/linode_api4/objects/lke.py index 4d3ec5a16..09a589355 100644 --- a/linode_api4/objects/lke.py +++ b/linode_api4/objects/lke.py @@ -19,7 +19,7 @@ class KubeVersion(Base): """ A KubeVersion is a version of Kubernetes that can be deployed on LKE. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubernetes-version-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-lke-version """ api_endpoint = "/lke/versions/{id}" @@ -120,7 +120,7 @@ class LKENodePool(DerivedBase): An LKE Node Pool describes a pool of Linode Instances that exist within an LKE Cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#node-pool-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-lke-node-pool """ api_endpoint = "/lke/clusters/{cluster_id}/pools/{id}" @@ -163,7 +163,7 @@ def recycle(self): Completing this operation may take several minutes. This operation will cause all local data on Linode Instances in this pool to be lost. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#node-pool-recycle + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-lke-cluster-pool-recycle """ self._client.post( "{}/recycle".format(LKENodePool.api_endpoint), model=self @@ -175,7 +175,7 @@ class LKECluster(Base): """ An LKE Cluster is a single k8s cluster deployed via Linode Kubernetes Engine. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubernetes-cluster-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-lke-cluster """ api_endpoint = "/lke/clusters/{id}" @@ -212,7 +212,7 @@ def api_endpoints(self): """ A list of API Endpoints for this Cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubernetes-api-endpoints-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-api-endpoints :returns: A list of MappedObjects of the API Endpoints :rtype: List[MappedObject] @@ -250,7 +250,7 @@ def kubeconfig(self): It may take a few minutes for a config to be ready when creating a new cluster; during that time this request may fail. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubeconfig-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-kubeconfig :returns: The Kubeconfig file for this Cluster. :rtype: str @@ -290,7 +290,7 @@ def node_pool_create(self, node_type, node_count, **kwargs): """ Creates a new :any:`LKENodePool` for this cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#node-pool-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-lke-cluster-pools :param node_type: The type of nodes to create in this pool. :type node_type: :any:`Type` or str @@ -324,7 +324,7 @@ def cluster_dashboard_url_view(self): """ Get a Kubernetes Dashboard access URL for this Cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubernetes-cluster-dashboard-url-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-dashboard :returns: The Kubernetes Dashboard access URL for this Cluster. :rtype: str @@ -340,7 +340,7 @@ def kubeconfig_delete(self): """ Delete and regenerate the Kubeconfig file for a Cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubeconfig-delete + API Documentation: https://techdocs.akamai.com/linode-api/reference/delete-lke-cluster-kubeconfig """ self._client.delete( @@ -351,7 +351,7 @@ def node_view(self, nodeId): """ Get a specific Node by ID. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#node-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-node :param nodeId: ID of the Node to look up. :type nodeId: str @@ -373,7 +373,7 @@ def node_delete(self, nodeId): """ Delete a specific Node from a Node Pool. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#node-delete + API Documentation: https://techdocs.akamai.com/linode-api/reference/delete-lke-cluster-node :param nodeId: ID of the Node to delete. :type nodeId: str @@ -390,7 +390,7 @@ def node_recycle(self, nodeId): """ Recycle a specific Node from an LKE cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#node-recycle + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-lke-cluster-node-recycle :param nodeId: ID of the Node to recycle. :type nodeId: str @@ -407,7 +407,7 @@ def cluster_nodes_recycle(self): """ Recycles all nodes in all pools of a designated Kubernetes Cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#cluster-nodes-recycle + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-lke-cluster-recycle """ self._client.post( @@ -418,7 +418,7 @@ def cluster_regenerate(self): """ Regenerate the Kubeconfig file and/or the service account token for a Cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#kubernetes-cluster-regenerate + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-lke-cluster-regenerate """ self._client.post( @@ -429,7 +429,7 @@ def service_token_delete(self): """ Delete and regenerate the service account token for a Cluster. - API Documentation: https://www.linode.com/docs/api/linode-kubernetes-engine-lke/#service-token-delete + API Documentation: https://techdocs.akamai.com/linode-api/reference/delete-lke-service-token """ self._client.delete( diff --git a/linode_api4/objects/longview.py b/linode_api4/objects/longview.py index 9d883693a..7a1ed56d5 100644 --- a/linode_api4/objects/longview.py +++ b/linode_api4/objects/longview.py @@ -5,7 +5,7 @@ class LongviewClient(Base): """ A Longview Client that is accessible for use. Longview is Linode’s system data graphing service. - API Documentation: https://www.linode.com/docs/api/longview/#longview-client-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-longview-client """ api_endpoint = "/longview/clients/{id}" @@ -25,7 +25,7 @@ class LongviewSubscription(Base): """ Contains the Longview Plan details for a specific subscription id. - API Documentation: https://www.linode.com/docs/api/longview/#longview-subscription-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-longview-subscription """ api_endpoint = "/longview/subscriptions/{id}" @@ -42,7 +42,7 @@ class LongviewPlan(Base): """ The current Longview Plan an account is using. - API Documentation: https://www.linode.com/docs/api/longview/#longview-plan-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-longview-plan """ api_endpoint = "/longview/plan" diff --git a/linode_api4/objects/networking.py b/linode_api4/objects/networking.py index dac295360..993961098 100644 --- a/linode_api4/objects/networking.py +++ b/linode_api4/objects/networking.py @@ -23,7 +23,7 @@ class IPv6Range(Base): """ An instance of a Linode IPv6 Range. - API Documentation: https://www.linode.com/docs/api/networking/#ipv6-range-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-ipv6-range """ api_endpoint = "/networking/ipv6/ranges/{range}" @@ -68,7 +68,7 @@ class IPAddress(Base): # Re-populate all attributes with new information from the API ip.invalidate() - API Documentation: https://www.linode.com/docs/api/networking/#ip-address-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-ip """ api_endpoint = "/networking/ips/{address}" @@ -144,7 +144,7 @@ class VLAN(Base): VLANs provide a mechanism for secure communication between two or more Linodes that are assigned to the same VLAN. VLANs are implicitly created during Instance or Instance Config creation. - API Documentation: https://www.linode.com/docs/api/networking/#vlans-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-vlans """ api_endpoint = "/networking/vlans/{label}" @@ -162,7 +162,7 @@ class FirewallDevice(DerivedBase): """ An object representing the assignment between a Linode Firewall and another Linode resource. - API Documentation: https://www.linode.com/docs/api/networking/#firewall-device-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-firewall-device """ api_endpoint = "/networking/firewalls/{firewall_id}/devices/{id}" @@ -183,7 +183,7 @@ class Firewall(Base): An instance of a Linode Cloud Firewall. - API Documentation: https://www.linode.com/docs/api/networking/#firewall-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-firewall """ api_endpoint = "/networking/firewalls/{id}" @@ -203,7 +203,7 @@ def update_rules(self, rules): """ Sets the JSON rules for this Firewall. - API Documentation: https://www.linode.com/docs/api/networking/#firewall-rules-update__request-samples + API Documentation: https://techdocs.akamai.com/linode-api/reference/put-firewall-rules :param rules: The rules to apply to this Firewall. :type rules: dict @@ -217,7 +217,7 @@ def get_rules(self): """ Gets the JSON rules for this Firewall. - API Documentation: https://www.linode.com/docs/api/networking/#firewall-rules-update__request-samples + API Documentation: https://techdocs.akamai.com/linode-api/reference/put-firewall-rules :returns: The rules that this Firewall is currently configured with. :rtype: dict @@ -230,7 +230,7 @@ def device_create(self, id, type="linode", **kwargs): """ Creates and attaches a device to this Firewall - API Documentation: https://www.linode.com/docs/api/networking/#firewall-device-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-firewall-device :param id: The ID of the entity to create a device for. :type id: int diff --git a/linode_api4/objects/nodebalancer.py b/linode_api4/objects/nodebalancer.py index c6f161ac8..2aeb6180c 100644 --- a/linode_api4/objects/nodebalancer.py +++ b/linode_api4/objects/nodebalancer.py @@ -16,7 +16,7 @@ class NodeBalancerNode(DerivedBase): """ The information about a single Node, a backend for this NodeBalancer’s configured port. - API documentation: https://www.linode.com/docs/api/nodebalancers/#node-view + API documentation: https://techdocs.akamai.com/linode-api/reference/get-node-balancer-node """ api_endpoint = ( @@ -61,7 +61,7 @@ class NodeBalancerConfig(DerivedBase): """ The configuration information for a single port of this NodeBalancer. - API documentation: https://www.linode.com/docs/api/nodebalancers/#config-view + API documentation: https://techdocs.akamai.com/linode-api/reference/get-node-balancer-config """ api_endpoint = "/nodebalancers/{nodebalancer_id}/configs/{id}" @@ -100,7 +100,7 @@ def nodes(self): Returns a paginated list of NodeBalancer nodes associated with this Config. These are the backends that will be sent traffic for this port. - API documentation: https://www.linode.com/docs/api/nodebalancers/#nodes-list + API documentation: https://techdocs.akamai.com/linode-api/reference/get-node-balancer-config-nodes :returns: A paginated list of NodeBalancer nodes. :rtype: PaginatedList of NodeBalancerNode @@ -127,7 +127,7 @@ def node_create(self, label, address, **kwargs): NodeBalancer Config. Nodes are routed requests on the configured port based on their status. - API documentation: https://www.linode.com/docs/api/nodebalancers/#node-create + API documentation: https://techdocs.akamai.com/linode-api/reference/post-node-balancer-node :param address: The private IP Address where this backend can be reached. This must be a private IP address. @@ -200,7 +200,7 @@ class NodeBalancer(Base): """ A single NodeBalancer you can access. - API documentation: https://www.linode.com/docs/api/nodebalancers/#nodebalancer-view + API documentation: https://techdocs.akamai.com/linode-api/reference/get-node-balancer """ api_endpoint = "/nodebalancers/{id}" @@ -227,7 +227,7 @@ def config_create(self, **kwargs): on a new port. You will need to add NodeBalancer Nodes to the new Config before it can actually serve requests. - API documentation: https://www.linode.com/docs/api/nodebalancers/#config-create + API documentation: https://techdocs.akamai.com/linode-api/reference/post-node-balancer-config :returns: The config that created successfully. :rtype: NodeBalancerConfig @@ -254,7 +254,7 @@ def config_rebuild(self, config_id, nodes, **kwargs): Rebuilds a NodeBalancer Config and its Nodes that you have permission to modify. Use this command to update a NodeBalancer’s Config and Nodes with a single request. - API documentation: https://www.linode.com/docs/api/nodebalancers/#config-rebuild + API documentation: https://techdocs.akamai.com/linode-api/reference/post-rebuild-node-balancer-config :param config_id: The ID of the Config to access. :type config_id: int @@ -289,7 +289,7 @@ def statistics(self): """ Returns detailed statistics about the requested NodeBalancer. - API documentation: https://www.linode.com/docs/api/nodebalancers/#nodebalancer-statistics-view + API documentation: https://techdocs.akamai.com/linode-api/reference/get-node-balancer-stats :returns: The requested stats. :rtype: MappedObject diff --git a/linode_api4/objects/object_storage.py b/linode_api4/objects/object_storage.py index 2cbcf59bd..f4ddfe9b5 100644 --- a/linode_api4/objects/object_storage.py +++ b/linode_api4/objects/object_storage.py @@ -32,7 +32,7 @@ class ObjectStorageBucket(DerivedBase): """ A bucket where objects are stored in. - API documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-view + API documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-bucket """ api_endpoint = "/object-storage/buckets/{region}/{label}" @@ -89,7 +89,7 @@ def access_modify( and/or setting canned ACLs. For more fine-grained control of both systems, please use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-access-modify + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-object-storage-bucket-access :param acl: The Access Control Level of the bucket using a canned ACL string. For more fine-grained control of ACLs, use the S3 API directly. @@ -130,7 +130,7 @@ def access_update( and/or setting canned ACLs. For more fine-grained control of both systems, please use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-access-update + API Documentation: https://techdocs.akamai.com/linode-api/reference/put-storage-bucket-access :param acl: The Access Control Level of the bucket using a canned ACL string. For more fine-grained control of ACLs, use the S3 API directly. @@ -165,7 +165,7 @@ def ssl_cert_delete(self): Deletes this Object Storage bucket’s user uploaded TLS/SSL certificate and private key. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-delete + API Documentation: https://techdocs.akamai.com/linode-api/reference/delete-object-storage-ssl :returns: True if the TLS/SSL certificate and private key in the bucket were successfully deleted. :rtype: bool @@ -189,7 +189,7 @@ def ssl_cert(self): if this bucket has a corresponding TLS/SSL certificate that was uploaded by an Account user. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-ssl :returns: A result object which has a bool field indicating if this Bucket has a corresponding TLS/SSL certificate that was uploaded by an Account user. @@ -217,7 +217,7 @@ def ssl_cert_upload(self, certificate, private_key): To replace an expired certificate, delete your current certificate and upload a new one. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-upload + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-object-storage-ssl :param certificate: Your Base64 encoded and PEM formatted SSL certificate. Line breaks must be represented as “\n” in the string @@ -267,7 +267,7 @@ def contents( This endpoint is available for convenience. It is recommended that instead you use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-contents-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-bucket-content :param marker: The “marker” for this request, which can be used to paginate through large buckets. Its value should be the value of the @@ -326,7 +326,7 @@ def object_acl_config(self, name=None): This endpoint is available for convenience. It is recommended that instead you use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-object-acl-config-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-bucket-acl :param name: The name of the object for which to retrieve its Access Control List (ACL). Use the Object Storage Bucket Contents List endpoint @@ -363,7 +363,7 @@ def object_acl_config_update(self, acl: ObjectStorageACL, name): This endpoint is available for convenience. It is recommended that instead you use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-object-acl-config-update + API Documentation: https://techdocs.akamai.com/linode-api/reference/put-object-storage-bucket-acl :param acl: The Access Control Level of the bucket, as a canned ACL string. For more fine-grained control of ACLs, use the S3 API directly. @@ -439,7 +439,7 @@ class ObjectStorageCluster(Base): A cluster where Object Storage is available. - API documentation: https://www.linode.com/docs/api/object-storage/#cluster-view + API documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-cluster """ api_endpoint = "/object-storage/clusters/{id}" @@ -466,7 +466,7 @@ def buckets_in_cluster(self, *filters): This endpoint is available for convenience. It is recommended that instead you use the more fully-featured S3 API directly. - API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-buckets-in-cluster-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-bucketin-cluster :param filters: Any number of filters to apply to this query. See :doc:`Filtering Collections` @@ -489,7 +489,7 @@ class ObjectStorageKeys(Base): """ A keypair that allows third-party applications to access Linode Object Storage. - API documentation: https://www.linode.com/docs/api/object-storage/#object-storage-key-view + API documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-key """ api_endpoint = "/object-storage/keys/{id}" diff --git a/linode_api4/objects/profile.py b/linode_api4/objects/profile.py index 1b9be8305..c37015e84 100644 --- a/linode_api4/objects/profile.py +++ b/linode_api4/objects/profile.py @@ -6,7 +6,7 @@ class AuthorizedApp(Base): """ An application with authorized access to an account. - API Documentation: https://www.linode.com/docs/api/profile/#authorized-app-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-profile-app """ api_endpoint = "/profile/apps/{id}" @@ -26,7 +26,7 @@ class PersonalAccessToken(Base): """ A Person Access Token associated with a Profile. - API Documentation: https://www.linode.com/docs/api/profile/#personal-access-token-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-personal-access-token """ api_endpoint = "/profile/tokens/{id}" @@ -60,7 +60,7 @@ class Profile(Base): """ A Profile containing information about the current User. - API Documentation: https://www.linode.com/docs/api/profile/#profile-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-profile """ api_endpoint = "/profile" @@ -88,7 +88,7 @@ def enable_tfa(self): Enables TFA for the token's user. This requies a follow-up request to confirm TFA. Returns the TFA secret that needs to be confirmed. - API Documentation: https://www.linode.com/docs/api/profile/#two-factor-secret-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-tfa-enable :returns: The TFA secret :rtype: str @@ -101,7 +101,7 @@ def confirm_tfa(self, code): """ Confirms TFA for an account. Needs a TFA code generated by enable_tfa - API Documentation: https://www.linode.com/docs/api/profile/#two-factor-authentication-confirmenable + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-tfa-confirm :param code: The Two Factor code you generated with your Two Factor secret. These codes are time-based, so be sure it is current. @@ -120,7 +120,7 @@ def disable_tfa(self): """ Turns off TFA for this user's account. - API Documentation: https://www.linode.com/docs/api/profile/#two-factor-authentication-disable + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-tfa-disable :returns: Returns true if operation was successful :rtype: bool @@ -134,7 +134,7 @@ def grants(self): """ Returns grants for the current user - API Documentation: https://www.linode.com/docs/api/profile/#grants-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-profile-grants :returns: The grants for the current user :rtype: UserGrants @@ -190,7 +190,7 @@ class SSHKey(Base): """ An SSH Public Key uploaded to your profile for use in Linode Instance deployments. - API Documentation: https://www.linode.com/docs/api/profile/#ssh-key-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-ssh-key """ api_endpoint = "/profile/sshkeys/{id}" @@ -207,7 +207,7 @@ class TrustedDevice(Base): """ A Trusted Device for a User. - API Documentation: https://www.linode.com/docs/api/profile/#trusted-device-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-trusted-device """ api_endpoint = "/profile/devices/{id}" @@ -226,7 +226,7 @@ class ProfileLogin(Base): """ A Login object displaying information about a successful account login from this user. - API Documentation: https://www.linode.com/docs/api/profile/#login-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-profile-login """ api_endpoint = "profile/logins/{id}" diff --git a/linode_api4/objects/region.py b/linode_api4/objects/region.py index 9356da523..6d8178eff 100644 --- a/linode_api4/objects/region.py +++ b/linode_api4/objects/region.py @@ -20,7 +20,7 @@ class Region(Base): """ A Region. Regions correspond to individual data centers, each located in a different geographical area. - API Documentation: https://www.linode.com/docs/api/regions/#region-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-region """ api_endpoint = "/regions/{id}" @@ -56,7 +56,7 @@ class RegionAvailabilityEntry(JSONObject): """ Represents the availability of a Linode type within a region. - API Documentation: https://www.linode.com/docs/api/regions/#region-availability-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-region-availability """ region: str = None diff --git a/linode_api4/objects/support.py b/linode_api4/objects/support.py index 78d1d86d1..f835b3f31 100644 --- a/linode_api4/objects/support.py +++ b/linode_api4/objects/support.py @@ -19,7 +19,7 @@ class TicketReply(DerivedBase): """ A reply to a Support Ticket. - API Documentation: https://www.linode.com/docs/api/support/#replies-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-ticket-replies """ api_endpoint = "/support/tickets/{ticket_id}/replies" @@ -40,7 +40,7 @@ class SupportTicket(Base): """ An objected representing a Linode Support Ticket. - API Documentation: https://www.linode.com/docs/api/support/#replies-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-ticket-replies """ api_endpoint = "/support/tickets/{id}" @@ -117,7 +117,7 @@ def post_reply(self, description): """ Adds a reply to an existing Support Ticket. - API Documentation: https://www.linode.com/docs/api/support/#reply-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-ticket-reply :param description: The content of this Support Ticket Reply. :type description: str @@ -146,7 +146,7 @@ def upload_attachment(self, attachment: Union[Path, str]): """ Uploads an attachment to an existing Support Ticket. - API Documentation: https://www.linode.com/docs/api/support/#support-ticket-attachment-create + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-ticket-attachment :param attachment: A path to the file to upload as an attachment. :type attachment: str @@ -187,7 +187,7 @@ def support_ticket_close(self): """ Closes a Support Ticket. - API Documentation: https://www.linode.com/docs/api/support/#support-ticket-close + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-close-ticket """ self._client.post("{}/close".format(self.api_endpoint), model=self) diff --git a/linode_api4/objects/tag.py b/linode_api4/objects/tag.py index 856f0d751..4f2e7b1cb 100644 --- a/linode_api4/objects/tag.py +++ b/linode_api4/objects/tag.py @@ -21,7 +21,7 @@ class Tag(Base): A User-defined labels attached to objects in your Account, such as Linodes. Used for specifying and grouping attributes of objects that are relevant to the User. - API Documentation: https://www.linode.com/docs/api/tags/#tags-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-tags """ api_endpoint = "/tags/{label}" @@ -64,7 +64,7 @@ def objects(self): Returns a list of objects with this Tag. This list may contain any taggable object type. - API Documentation: https://www.linode.com/docs/api/tags/#tagged-objects-list + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-tagged-objects :returns: Objects with this Tag :rtype: PaginatedList of objects with this Tag diff --git a/linode_api4/objects/volume.py b/linode_api4/objects/volume.py index 365ceb2d3..6b126cc75 100644 --- a/linode_api4/objects/volume.py +++ b/linode_api4/objects/volume.py @@ -7,7 +7,7 @@ class Volume(Base): A single Block Storage Volume. Block Storage Volumes are persistent storage devices that can be attached to a Compute Instance and used to store any type of data. - API Documentation: https://www.linode.com/docs/api/volumes/#volume-view + API Documentation: https://techdocs.akamai.com/linode-api/reference/get-volume """ api_endpoint = "/volumes/{id}" @@ -31,7 +31,7 @@ def attach(self, to_linode, config=None): """ Attaches this Volume to the given Linode. - API Documentation: https://www.linode.com/docs/api/volumes/#volume-attach + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-attach-volume :param to_linode: The ID or object of the Linode to attach the volume to. :type to_linode: Union[Instance, int] @@ -70,7 +70,7 @@ def detach(self): """ Detaches this Volume if it is attached - API Documentation: https://www.linode.com/docs/api/volumes/#volume-detach + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-detach-volume :returns: Returns true if operation was successful :rtype: bool @@ -83,7 +83,7 @@ def resize(self, size): """ Resizes this Volume - API Documentation: https://www.linode.com/docs/api/volumes/#volume-resize + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-resize-volume :param size: The Volume’s size, in GiB. :type size: int @@ -105,7 +105,7 @@ def clone(self, label): """ Clones this volume to a new volume in the same region with the given label - API Documentation: https://www.linode.com/docs/api/volumes/#volume-clone + API Documentation: https://techdocs.akamai.com/linode-api/reference/post-clone-volume :param label: The label for the new volume. :type label: str diff --git a/pyproject.toml b/pyproject.toml index ea96865c1..6720a965c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "linode_api4" -authors = [{ name = "Linode", email = "developers@linode.com" }] +authors = [{ name = "Linode", email = "devs@linode.com" }] description = "The official Python SDK for Linode API v4" readme = "README.rst" requires-python = ">=3.8" From e7f3fc92bddb91470d6b378ece5cbff14eb04a20 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Tue, 23 Jul 2024 11:45:35 -0400 Subject: [PATCH 6/7] Add LDE LA disclaimer --- linode_api4/groups/linode.py | 1 + linode_api4/objects/linode.py | 1 + 2 files changed, 2 insertions(+) diff --git a/linode_api4/groups/linode.py b/linode_api4/groups/linode.py index c146ce46c..68126d20d 100644 --- a/linode_api4/groups/linode.py +++ b/linode_api4/groups/linode.py @@ -274,6 +274,7 @@ def instance_create( :param firewall: The firewall to attach this Linode to. :type firewall: int or Firewall :param disk_encryption: The disk encryption policy for this Linode. + NOTE: Disk encryption may not currently be available to all users. :type disk_encryption: InstanceDiskEncryptionType or str :param interfaces: An array of Network Interfaces to add to this Linode’s Configuration Profile. At least one and up to three Interface objects can exist in this array. diff --git a/linode_api4/objects/linode.py b/linode_api4/objects/linode.py index afcf6c2d5..7b3ace39f 100644 --- a/linode_api4/objects/linode.py +++ b/linode_api4/objects/linode.py @@ -1435,6 +1435,7 @@ def rebuild( the key. :type authorized_keys: list or str :param disk_encryption: The disk encryption policy for this Linode. + NOTE: Disk encryption may not currently be available to all users. :type disk_encryption: InstanceDiskEncryptionType or str :returns: The newly generated password, if one was not provided From 536118ae1707f3b02bcb78aae8340e1040c24f40 Mon Sep 17 00:00:00 2001 From: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:39:50 -0400 Subject: [PATCH 7/7] test: Temporarily disable LDE integration tests (#444) * Temporarily disable LDE tests * various fixes --- test/integration/conftest.py | 3 ++- test/integration/models/linode/test_linode.py | 15 ++++++++++++--- test/integration/models/lke/test_lke.py | 11 ++++++++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/test/integration/conftest.py b/test/integration/conftest.py index 9ef80e903..e50ac3abc 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -496,5 +496,6 @@ def create_placement_group_with_linode( @pytest.mark.smoke def pytest_configure(config): config.addinivalue_line( - "markers", "smoke: mark test as part of smoke test suite" + "markers", + "smoke: mark test as part of smoke test suite", ) diff --git a/test/integration/models/linode/test_linode.py b/test/integration/models/linode/test_linode.py index 01f3aaa16..afedce93d 100644 --- a/test/integration/models/linode/test_linode.py +++ b/test/integration/models/linode/test_linode.py @@ -195,7 +195,11 @@ def test_linode_transfer(test_linode_client, linode_with_volume_firewall): def test_linode_rebuild(test_linode_client): client = test_linode_client - chosen_region = get_region(client, {"Disk Encryption"}) + + # TODO(LDE): Uncomment once LDE is available + # chosen_region = get_region(client, {"Disk Encryption"}) + chosen_region = get_region(client) + label = get_test_label() + "_rebuild" linode, password = client.linode.instance_create( @@ -208,14 +212,17 @@ def test_linode_rebuild(test_linode_client): 3, linode.rebuild, "linode/debian10", - disk_encryption=InstanceDiskEncryptionType.disabled, + # TODO(LDE): Uncomment once LDE is available + # disk_encryption=InstanceDiskEncryptionType.disabled, ) wait_for_condition(10, 100, get_status, linode, "rebuilding") assert linode.status == "rebuilding" assert linode.image.id == "linode/debian10" - assert linode.disk_encryption == InstanceDiskEncryptionType.disabled + + # TODO(LDE): Uncomment once LDE is available + # assert linode.disk_encryption == InstanceDiskEncryptionType.disabled wait_for_condition(10, 300, get_status, linode, "running") @@ -418,6 +425,8 @@ def test_linode_volumes(linode_with_volume_firewall): assert "test" in volumes[0].label +# TODO(LDE): Remove skip once LDE is available +@pytest.mark.skip("LDE is not currently enabled") @pytest.mark.parametrize( "linode_with_disk_encryption", ["disabled"], indirect=True ) diff --git a/test/integration/models/lke/test_lke.py b/test/integration/models/lke/test_lke.py index ce6700b80..cf46ed850 100644 --- a/test/integration/models/lke/test_lke.py +++ b/test/integration/models/lke/test_lke.py @@ -11,7 +11,6 @@ import pytest from linode_api4 import ( - InstanceDiskEncryptionType, LKEClusterControlPlaneACLAddressesOptions, LKEClusterControlPlaneACLOptions, LKEClusterControlPlaneOptions, @@ -24,7 +23,11 @@ def lke_cluster(test_linode_client): node_type = test_linode_client.linode.types()[1] # g6-standard-1 version = test_linode_client.lke.versions()[0] - region = get_region(test_linode_client, {"Disk Encryption", "Kubernetes"}) + + # TODO(LDE): Uncomment once LDE is available + # region = get_region(test_linode_client, {"Kubernetes", "Disk Encryption"}) + region = get_region(test_linode_client, {"Kubernetes"}) + node_pools = test_linode_client.lke.node_pool(node_type, 3) label = get_test_label() + "_cluster" @@ -98,7 +101,9 @@ def _to_comparable(p: LKENodePool) -> Dict[str, Any]: return {k: v for k, v in p._raw_json.items() if k not in {"nodes"}} assert _to_comparable(cluster.pools[0]) == _to_comparable(pool) - assert pool.disk_encryption == InstanceDiskEncryptionType.enabled + + # TODO(LDE): Uncomment once LDE is available + # assert pool.disk_encryption == InstanceDiskEncryptionType.enabled def test_cluster_dashboard_url_view(lke_cluster):