-
See Also
- ServiceExecute
- ServiceConnect
-
- Service Connections
- CharityEngine
-
- Remote Batch Computation Providers
- AWSBatch
- Workflows
-
-
See Also
- ServiceExecute
- ServiceConnect
-
- Service Connections
- CharityEngine
-
- Remote Batch Computation Providers
- AWSBatch
- Workflows
-
See Also
"AWS" (Service Connection)
Connecting & Authenticating
Meta Requests
Service Metadata
"Services" — list available AWS services
Obtain Child Service Objects
"GetService" — obtain a child ServiceObject representing a single AWS service
| "Name" | (required) | AWS service to access |
Child Service Requests
List Requests
"Requests" — list available requests for the service
Request Metadata
"RequestTemplate" — show the expected structure of a request's payload
"ResponseTemplate" — show the expected structure of a request's response data
| "Request" | (required) | name of request to inspect |
Parameter Details
| "IncludeBodyByteArray" | False | include ByteArray of raw response body | |
| "RawResponse" | False | return full response and failure data | |
| "RequestEndpoint" | Automatic | custom HTTP endpoint | |
| "RequestRegion" | Automatic | override globally specified AWS region | |
| "ValidateRequest" | True | validate request structure before sending |
Examples
open all close allBasic Examples (2)
aws = ServiceConnect["AWS"]List the available AWS services:
ServiceExecute["AWS", "Services"]//ShortObtain a child ServiceObject representing Amazon Translate:
translate = ServiceExecute[aws, "GetService", <|"Name" -> "Translate"|>]List available requests for the service:
translate["Requests"]Obtain a request template for the "TranslateText" request:
translate["RequestTemplate", <|"Request" -> "TranslateText"|>]Send a "TranslateText" request:
translate["TranslateText", <|
"Text" -> "今日は良い一日だった",
"SourceLanguageCode" -> "auto",
"TargetLanguageCode" -> "en"|>
]Obtain a response template for a request:
ec2 = ServiceExecute["AWS", "GetService", "Name" -> "EC2"];
ec2["ResponseTemplate", "Request" -> "GetReservedInstancesExchangeQuote"]Request Parameters (5)
"IncludeBodyByteArray" (1)
Setting "IncludeBodyByteArray"True causes a "BodyByteArray" key to be included in the raw response association:
ec2 = ServiceExecute["AWS", "GetService", <|"Name" -> "EC2"|>];
ec2["DescribeVolumes",
<|"RawResponse" -> True,
"IncludeBodyByteArray" -> True|>]The value of "BodyByteArray" is the raw response body directly from the server:
%["BodyByteArray"]//ByteArrayToStringIf a request fails, "BodyByteArray" will be included regardless of the "IncludeBodyByteArray" setting:
ec2["DescribeVolumes", <|"NextToken" -> "foo", "RawResponse" -> True|>]"RawResponse" (1)
Setting "RawResponse"True causes an association containing response data and metadata to be returned:
ec2 = ServiceExecute["AWS", <|"GetService", "Name" -> "EC2"|>];
ec2["DescribeVolumes", <|"RawResponse" -> True|>]If the request fails, the value of the "Data" key will be a Failure object:
ec2["DescribeVolumes", <|"NextToken" -> "foo", "RawResponse" -> True|>]"RequestEndpoint" (1)
Certain situations may call for the use of a nondefault service endpoint:
mediaconvert = ServiceExecute["AWS", "GetService", <|"Name" -> "MediaConvert"|>];
mediaconvert["ListJobs"]Supply a custom endpoint with the "RequestEndpoint" parameter:
mediaconvert["ListJobs", <|"RequestEndpoint" -> "https://abcd1234.mediaconvert.us-east-1.amazonaws.com"|>]["Jobs", 1]"RequestRegion" (1)
Some services are available only in certain regions:
groundstation = ServiceExecute["AWS", "GetService", <|"Name" -> "GroundStation"|>];
groundstation["ListSatellites"]The "RequestRegion" parameter overrides the default region on a per-request basis:
groundstation["ListSatellites", <|"RequestRegion" -> "me-south-1"|>]"ValidateRequest" (1)
By default, request parameters are validated against the expected structure before sending the request:
translate = ServiceExecute["AWS", "GetService", "Name" -> "Translate"];
translate["TranslateText",
<|"Text" -> "今日は良い一日だった",
"SourceLanguageCode" -> "auto"|>
]With "ValidateRequest"False, local validation is disabled, which may result in server errors:
translate["TranslateText",
<|"Text" -> "今日は良い一日だった",
"SourceLanguageCode" -> "auto",
"ValidateRequest" -> False|>
]Possible Issues (1)
With default settings, a server error will cause ServiceExecute to emit a message and return unevaluated:
ec2 = ServiceExecute["AWS", "GetService", <|"Name" -> "EC2"|>];
ec2["DescribeVolumes", <|"NextToken" -> "foo"|>]Use "RawResponse"True to instead return an association containing a Failure object:
ec2["DescribeVolumes", <|"NextToken" -> "foo", "RawResponse" -> True|>]See Also
ServiceExecute ▪ ServiceConnect
Service Connections: CharityEngine
Remote Batch Computation Providers: AWSBatch
Related Workflows
- Authenticate with Amazon Web Services