This tool provided a curl like API to make request to AWS services.
Some AWS API (e.g. aws sagemaker-runtime) arbitrary request body. It's hard to hand craft these body. This tools uses curl compatible command line options to help construct different type of request body.
You can download awscurl
like this:
# download stable release version:
curl -O https://publish.djl.ai/awscurl/0.28.0/awscurl \
&& chmod +x awscurl
# or download nightly release
curl -O https://publish.djl.ai/awscurl/awscurl \
&& chmod +x awscurl
You can build it using gradle:
./gradlew build
You will find a jar file in build/libs folder.
This tool uses the same ways as AWS CLI to load AWS credentials: Configuring the AWS CLI
You can use --profile option to use Named Profiles.
region name is requird to sign SigV4 request. region can be obtained in following order:
- passed by parameter --region
- inferred from url if url using [XXX.]SERVICE.REGION-NAME.amazonaws.com or [XXX.]REGION-NAME.SERVICE.amazonaws.com format.
- get region name from ~/.aws/credentials file
- get region name from ~/.aws/config file
java -jar awscurl.jar -h
awscurl -n sagemaker https://runtime.sagemaker.us-east-1.amazonaws.com/endpoints/mms-demo/invocations -F "data=@kitten.jpg" -F "model_name=squeezenet_v1.1"
- Doesn't support SigV4 Chunked upload
- This tool load request body into memory, the max size of body can up to 2G. The actual body is also limited by java heap size.
- Unlike AWS CLI can find URL by itself, caller must specify AWS service endpoint url.