qctrl-workflow-client 1.1.0__tar.gz → 1.2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qctrl-workflow-client
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Q-CTRL Client
5
5
  Home-page: https://q-ctrl.com
6
6
  License: https://q-ctrl.com/terms
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "qctrl-workflow-client"
3
- version = "1.1.0"
3
+ version = "1.2.0"
4
4
  description = "Q-CTRL Client"
5
5
  license = "https://q-ctrl.com/terms"
6
6
  authors = ["Q-CTRL <support@q-ctrl.com>"]
@@ -11,7 +11,7 @@
11
11
  # distributed under the License is distributed on an "AS IS" BASIS. See the
12
12
  # License for the specific language.
13
13
 
14
- __version__ = "1.1.0"
14
+ __version__ = "1.2.0"
15
15
 
16
16
  from .defaults import (
17
17
  get_authenticated_client_for_product,
@@ -575,7 +575,7 @@ class ApiRouter(BaseRouter):
575
575
  Wait until the requested number of machines are online.
576
576
  """
577
577
 
578
- number_of_machines_online = self._get_number_of_machines_online()
578
+ number_of_machines_online = self.get_machine_status()["online"]
579
579
 
580
580
  def machines(count: int) -> str:
581
581
  if count == 1:
@@ -591,9 +591,9 @@ class ApiRouter(BaseRouter):
591
591
  "requested": number_of_machines_requested,
592
592
  }
593
593
 
594
- def _get_number_of_machines_online(self) -> int:
594
+ def get_machine_status(self) -> dict[str, int]:
595
595
  """
596
- Return the number of machines that are online.
596
+ Return the current state of all machines.
597
597
  """
598
598
  _query = gql.gql(
599
599
  """
@@ -601,8 +601,12 @@ class ApiRouter(BaseRouter):
601
601
  tenant(organizationId:$organizationId) {
602
602
  tenant {
603
603
  currentInstances {
604
+ initializing
605
+ offline
604
606
  online
605
- }
607
+ pending
608
+ terminating
609
+ }
606
610
  }
607
611
  errors {
608
612
  message
@@ -616,10 +620,7 @@ class ApiRouter(BaseRouter):
616
620
  _query,
617
621
  {"organizationId": self._get_configured_organization().organization_id},
618
622
  )
619
- number_of_machines_online = response["tenant"]["tenant"]["currentInstances"][
620
- "online"
621
- ]
622
- return number_of_machines_online
623
+ return response["tenant"]["tenant"]["currentInstances"]
623
624
 
624
625
  def activity_monitor(
625
626
  self,