in azext_edge/edge/util/common.py [0:0]
def _process_raw_request(cmd, url: str, method: str, payload: Optional[dict] = None, keyword: str = "data"):
# since I don't want to download the resourcegraph sdk - we are stuck with this
# note that we are trying to limit dependencies
from azure.cli.core.util import send_raw_request
result = []
skip_token = "sentinel"
while skip_token:
try:
body = json.dumps(payload) if payload is not None else None
res = send_raw_request(cli_ctx=cmd.cli_ctx, url=url, method=method, body=body)
except Exception as e:
raise e
if not res.content:
return
json_response = res.json()
result.extend(json_response[keyword])
skip_token = json_response.get("$skipToken")
if skip_token:
if not payload:
payload = {"options": {}}
if "options" not in payload:
payload["options"] = {}
payload["options"]["$skipToken"] = skip_token
return result