copr: actually, the highest possible limit is 100

ibm_cloud_sdk_core.api_exception.ApiException:
    Error: The `limit` parameter is invalid, it must be an integer
    between 1 and 100., Code: 400
This commit is contained in:
Jakub Kadlcik 2022-08-26 03:58:09 +02:00
parent a8ec3232b5
commit c77da1641e
2 changed files with 4 additions and 2 deletions

View file

@ -11,7 +11,9 @@ from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
DEFAULT_TOKEN_FILE = "{{ ibmcloud_token_file }}"
SERVICE_URL = "https://jp-tok.iaas.cloud.ibm.com/v1"
LIMIT = 999
# Using the highest value possible
LIMIT = 100
def _get_arg_parser():

View file

@ -253,7 +253,7 @@ def delete_instance_attempt(service, instance_name, opts):
# Query all volumes only after already potentionaly deleting an instance.
# The volumes might have been deleted automatically
volume_ids = []
volumes = service.list_volumes(limit=999).result["volumes"]
volumes = service.list_volumes(limit=100).result["volumes"]
for volume in volumes:
if volume["name"].startswith(instance_name):
volume_ids.append(volume["id"])