canvas-data-cli icon indicating copy to clipboard operation
canvas-data-cli copied to clipboard

historical_requests url format

Open dtod opened this issue 3 years ago • 2 comments

Description

Downloaded latest version and ran the historical_requests command

canvasDataCli historical-requests -c config.js

Date ranges were not part of the output.

In https://github.com/instructure/canvas-data-cli/blob/master/src/HistoricalRequests.js

getRangeForFile parses the url with url.split('/')[7]. However, when I look at our URLs, they are not in that format. They are:

https://bucket.amazonaws.com/ACCOUNT/requests/RANGE/etc/etc

Therefore the code should be url.split('/')[5]

I made this change in my local copy and it resolved the issue.

Additional Information

  • Node Version v18.2.0
  • Platform: Alpline 3.16.0
  • Logs: (If you can please run the CLI with: -l debug and provide us the debug logs.)

dtod avatar May 26 '22 16:05 dtod

FWIW, I built this with a Docker container

Dockerfile contents

FROM alpine:latest

RUN apk add nodejs npm RUN apk add nodejs-current

RUN npm install -g canvas-data-cli

====

docker build -t canvasdata . docker run -it --rm --name canvasdata canvasdata

dtod avatar May 26 '22 16:05 dtod

The urls in my original note lost the code elements

New format is:

"https://BUCKET.amazonaws.com/ACCOUNT/requests/RANGE/etc/etc"

dtod avatar May 26 '22 17:05 dtod