Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dt.Claim.claim() parameter dry_run now True #117

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions disruptive/resources/claim.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def claim_info(cls, identifier: str, **kwargs: Any) -> Claim:
def claim(target_project_id: str,
kit_ids: Optional[List[str]] = None,
device_ids: Optional[List[str]] = None,
dry_run: bool = False,
dry_run: bool = True,
**kwargs: Any,
) -> Tuple[List[Claim.ClaimDevice], List[Exception]]:
"""
Expand All @@ -119,8 +119,10 @@ def claim(target_project_id: str,
device_ids : list[str], optional
List of unique device IDs to claim.
dry_run : bool, optional
Default True.
Test your claim request during development.
No kits or devices will be claimed.
No kits or devices will be claimed while True.
Set to False in production or no devices will be claimed.
**kwargs
Arbitrary keyword arguments.
See the :ref:`Configuration <configuration>` page.
Expand All @@ -135,13 +137,13 @@ def claim(target_project_id: str,

Examples
--------
>>> # Claim all devices in a single kit.
>>> # Do a dry_run where you simulate claiming a kit.
>>> devices, errors = dt.Claim.claim(
... target_project_id='<TARGET_PROJECT_ID>',
... kit_ids=['<KIT_ID>'],
... )

>>> # Claim specific devices.
>>> # Do a dry_run where you simulate claiming three devices.
>>> devices, errors = dt.Claim.claim(
... target_project_id='<TARGET_PROJECT_ID>',
... device_ids=[
Expand All @@ -151,8 +153,8 @@ def claim(target_project_id: str,
... ],
... )

>>> # Do a dry run where you simulate claiming a few kits and devices.
>>> # No kits or devices will be claim during this process.
>>> # Turn off dry_run and claim 2 kits and 3 devices.
>>> # This action is not reversible.
>>> devices, errors = dt.Claim.claim(
... target_project_id='<TARGET_PROJECT_ID>',
... kit_ids=[
Expand All @@ -164,7 +166,7 @@ def claim(target_project_id: str,
... '<DEVICE_ID_2>',
... '<DEVICE_ID_3>',
... ]
... dry_run=True,
... dry_run=False,
... )

"""
Expand Down