AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the Amazon SageMaker Gateway Runtime InvokeGlobalInferenceGatewayWithResponseStream API operation.

Syntax

Invoke-SMGWRGlobalInferenceGatewayWithResponseStream
-Accept <String>
-Body <Byte[]>
-ContentType <String>
-CustomerIdentityToken <String>
-GatewayId <String>
-Select <String>
-Force <SwitchParameter>
-ClientConfig <AmazonSageMakerGatewayRuntimeConfig>

Description

Streaming inference. Returns an AWS event stream of PayloadPart events that carry the model server's server-sent event (SSE) bytes, so SDKs decode the stream into events for you. The errors listed for this operation, other than ModelStreamError and InternalStreamFailure, are returned before the response starts (before the 200 status), so they end the request, not the stream. None of them can occur after the 200. ModelStreamError and InternalStreamFailure appear only as events in the stream, after the 200. Once the 200 is sent, the stream carries the response as PayloadPart events. If reading the inference gateway's response fails, the stream carries one InternalStreamFailure event and then ends. ModelStreamError is reserved and is not currently sent. Errors carry their origin in the `Message` prefix. Every typed error's text is in the `Message` member (JSON key `Message`), and starts with one of these prefixes: * `Global Inference Gateway: ` -- the gateway rejected or failed the request itself: validation, authorization, throttling, routing (the gateway or model was not found, or no capacity is available), a gateway limit or time limit, or failing to reach the inference gateway (`Global Inference Gateway: could not reach the inference gateway: <reason>`, or `Global Inference Gateway: timed out waiting for the inference gateway`). This includes the 400 for an invalid request and the 413 for a request body that is too large. * `inference gateway: ` -- the inference gateway serving the model returned an error status. The message gives that status code and up to 256 bytes of its error message, for example `inference gateway: 503 <message>`. * `inference gateway (<component>): ` -- the same, when the inference gateway reports which of its components produced the error, for example `inference gateway (model server): 502 <message>`. The component is one of: * `config` -- the inference gateway's configuration and proxy layer. * `scheduler` -- the inference gateway's request scheduler. * `model selector` -- the inference gateway's model selector. * `model server` -- the model server. An InternalStreamFailure event's `Message` uses the same prefixes, with the same text the buffered operation uses for the same failure. Its `inference gateway: ` message carries no status: `inference gateway: response ended unexpectedly` when the inference gateway's connection failed while it was sending the response. Every error status the inference gateway returns before the 200 is a typed error, chosen by that status as for InvokeGlobalInferenceGateway: * 400 and any other 4xx not listed here -- a 400 validation error. * 401 and 403 -- AccessDeniedException (403). * 404 -- ResourceNotFoundException. * 408 -- GatewayTimeoutException (504). * 429 -- ThrottlingException, with the `Retry-After` header. * 502, and 500, 503 or any other 5xx not listed here -- BadGatewayException (502). A 500 or 503 from the inference gateway comes after the request was dispatched, so it is not modeled as retryable, and the gateway may already have tried another inference gateway. Standard SDK retry modes may still retry a 5xx status; set max attempts to 1 if a repeated inference is unacceptable. * 504 -- GatewayTimeoutException.

Parameters

-Accept <String>
The MIME type you want for the response. It is passed to the model server.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Body <Byte[]>
The inference request body, as for InvokeGlobalInferenceGateway, except that the request is always sent with `"stream": true`: this operation returns an event stream, so a `"stream": false` in the body (or no `stream` key) is overridden. A body larger than 10 MiB is rejected with PayloadTooLargeException (413).The cmdlet will automatically convert the supplied parameter of type string, string[], System.IO.FileInfo or System.IO.Stream to byte[] before supplying it to the service.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
Amazon.PowerShell.Cmdlets.SMGWR.AmazonSageMakerGatewayRuntimeClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ContentType <String>
The MIME type of the request body, as for InvokeGlobalInferenceGateway. Pass `application/json`.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-CustomerIdentityToken <String>
The customer identity token (a JWT), as for InvokeGlobalInferenceGateway. It is passed unchanged to the inference gateway, which validates it.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-GatewayId <String>
The ID of the Global Inference Gateway to invoke, as for InvokeGlobalInferenceGateway.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is 'Body'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.SageMakerGatewayRuntime.Model.InvokeGlobalInferenceGatewayWithResponseStreamResponse). Specifying the name of a property of type Amazon.SageMakerGatewayRuntime.Model.InvokeGlobalInferenceGatewayWithResponseStreamResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns an Amazon.SageMakerGatewayRuntime.Model.ResponseStream object. The service call response (type Amazon.SageMakerGatewayRuntime.Model.InvokeGlobalInferenceGatewayWithResponseStreamResponse) can be returned by specifying '-Select *'.

Supported Version

AWS Tools for PowerShell: 2.x.y.z