ListScriptsCommand

Retrieves script records for all Realtime scripts that are associated with the Amazon Web Services account in use.

Learn more

Related actions

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GameLiftClient, ListScriptsCommand } from "@aws-sdk/client-gamelift"; // ES Modules import
// const { GameLiftClient, ListScriptsCommand } = require("@aws-sdk/client-gamelift"); // CommonJS import
const client = new GameLiftClient(config);
const input = { // ListScriptsInput
  Limit: Number("int"),
  NextToken: "STRING_VALUE",
};
const command = new ListScriptsCommand(input);
const response = await client.send(command);
// { // ListScriptsOutput
//   Scripts: [ // ScriptList
//     { // Script
//       ScriptId: "STRING_VALUE",
//       ScriptArn: "STRING_VALUE",
//       Name: "STRING_VALUE",
//       Version: "STRING_VALUE",
//       SizeOnDisk: Number("long"),
//       CreationTime: new Date("TIMESTAMP"),
//       StorageLocation: { // S3Location
//         Bucket: "STRING_VALUE",
//         Key: "STRING_VALUE",
//         RoleArn: "STRING_VALUE",
//         ObjectVersion: "STRING_VALUE",
//       },
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

ListScriptsCommand Input

See ListScriptsCommandInput for more details

Parameter
Type
Description
Limit
number | undefined

The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

NextToken
string | undefined

A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.

ListScriptsCommand Output

See ListScriptsCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
NextToken
string | undefined

A token that indicates where to resume retrieving results on the next call to this operation. If no token is returned, these results represent the end of the list.

Scripts
Script[] | undefined

A set of properties describing the requested script.

Throws

Name
Fault
Details
InternalServiceException
server

The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

InvalidRequestException
client

One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

UnauthorizedException
client

The client failed authentication. Clients should not retry such requests.

GameLiftServiceException
Base exception class for all service exceptions from GameLift service.