azimuth-robotframework 0.2.10__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/clusters.py +7 -0
  2. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/external_ips.py +6 -1
  3. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/kubernetes_app_templates.py +1 -1
  4. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/kubernetes_apps.py +12 -0
  5. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/kubernetes_cluster_templates.py +18 -0
  6. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/kubernetes_clusters.py +7 -0
  7. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/PKG-INFO +1 -1
  8. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/azimuth_robotframework.egg-info/PKG-INFO +1 -1
  9. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/.github/workflows/pypi-publish.yaml +0 -0
  10. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/.gitignore +0 -0
  11. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/__init__.py +0 -0
  12. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/cluster_types.py +0 -0
  13. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/main.py +0 -0
  14. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/sizes.py +0 -0
  15. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/util.py +0 -0
  16. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/Azimuth/zenith.py +0 -0
  17. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/LICENSE +0 -0
  18. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/README.md +0 -0
  19. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/azimuth_robotframework.egg-info/SOURCES.txt +0 -0
  20. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/azimuth_robotframework.egg-info/dependency_links.txt +0 -0
  21. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/azimuth_robotframework.egg-info/not-zip-safe +0 -0
  22. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/azimuth_robotframework.egg-info/requires.txt +0 -0
  23. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/azimuth_robotframework.egg-info/top_level.txt +0 -0
  24. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/pyproject.toml +0 -0
  25. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/setup.cfg +0 -0
  26. {azimuth-robotframework-0.2.10 → azimuth_robotframework-0.3.0}/setup.py +0 -0
@@ -56,6 +56,13 @@ class ClusterKeywords:
56
56
  "parameter_values": parameter_values,
57
57
  })
58
58
 
59
+ @keyword
60
+ def patch_cluster(self, id: str) -> t.Dict[str, t.Any]:
61
+ """
62
+ Patches the specified cluster.
63
+ """
64
+ return self._resource.action(id, "patch")
65
+
59
66
  @keyword
60
67
  def delete_cluster(self, id: str, interval: int = 15):
61
68
  """
@@ -46,7 +46,12 @@ class ExternalIpKeywords:
46
46
  If no such IP exists, an exception is raised.
47
47
  """
48
48
  try:
49
- return next(ip for ip in self._resource.list() if ip.machine is None)
49
+ return next(
50
+ ip
51
+ for ip in self._resource.list()
52
+ # Use the available flag if present, falling back to using the machine
53
+ if ip.get("available", ip.machine is None)
54
+ )
50
55
  except StopIteration:
51
56
  raise ValueError("unable to find an unassigned external IP address")
52
57
 
@@ -39,7 +39,7 @@ class KubernetesAppTemplateKeywords:
39
39
  Returns the latest version for the Kubernetes app template.
40
40
  """
41
41
  try:
42
- return next(iter(template.versions))
42
+ return next(iter(template["versions"]))
43
43
  except StopIteration:
44
44
  raise AssertionError(f"no versions for Kubernetes app template '{template.id}'")
45
45
 
@@ -58,6 +58,18 @@ class KubernetesAppKeywords:
58
58
  "values": values,
59
59
  })
60
60
 
61
+ @keyword
62
+ def update_kubernetes_app(
63
+ self,
64
+ id: str,
65
+ version: t.Dict[str, t.Any],
66
+ values: t.Dict[str, t.Any]
67
+ ) -> t.Dict[str, t.Any]:
68
+ """
69
+ Update the specified Kubernetes app with the given version and values.
70
+ """
71
+ return self._resource.patch(id, {"version": version["name"], "values": values})
72
+
61
73
  @keyword
62
74
  def delete_kubernetes_app(self, id: str, interval: int = 15):
63
75
  """
@@ -83,3 +83,21 @@ class KubernetesClusterTemplateKeywords:
83
83
  if not latest_template:
84
84
  raise ValueError("no template matching conditions")
85
85
  return latest_template
86
+
87
+ @keyword
88
+ def find_kubernetes_cluster_template_for_upgrade(self, id: str) -> t.Dict[str, t.Any]:
89
+ """
90
+ Given the ID of an existing template, find the latest template that a cluster using
91
+ that template can be upgraded to.
92
+ """
93
+ template = self.fetch_kubernetes_cluster_template(id)
94
+ # The Kubernetes version for the new template must be the same or newer than the
95
+ # given template and no more than one minor version newer than the given template
96
+ # We also restrict the search to non-deprecated templates with the same tags
97
+ current_version = easysemver.Version(template.kubernetes_version)
98
+ upper_bound = current_version.bump_minor().bump_minor()
99
+ return self.find_latest_kubernetes_cluster_template(
100
+ constraints = f">={current_version},<{upper_bound}",
101
+ tags = template.get("tags", []),
102
+ include_deprecated = False
103
+ )
@@ -239,6 +239,13 @@ class KubernetesClusterKeywords:
239
239
  """
240
240
  return self._resource.create(dataclasses.asdict(config))
241
241
 
242
+ @keyword
243
+ def upgrade_kubernetes_cluster(self, id: str, template_id: str) -> t.Dict[str, t.Any]:
244
+ """
245
+ Upgrades the specified Kubernetes cluster to a new template.
246
+ """
247
+ return self._resource.patch(id, {"template": template_id})
248
+
242
249
  @keyword
243
250
  def delete_kubernetes_cluster(self, id: str, interval: int = 15):
244
251
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: azimuth-robotframework
3
- Version: 0.2.10
3
+ Version: 0.3.0
4
4
  Summary: Robot framework library for interacting with Azimuth.
5
5
  Home-page: https://github.com/stackhpc/azimuth-robotframework
6
6
  Author: Matt Pryor
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: azimuth-robotframework
3
- Version: 0.2.10
3
+ Version: 0.3.0
4
4
  Summary: Robot framework library for interacting with Azimuth.
5
5
  Home-page: https://github.com/stackhpc/azimuth-robotframework
6
6
  Author: Matt Pryor