GetSchemaVersionCommand

Get the specified schema by its unique ID assigned when a version of the schema is created or registered. Schema versions in Deleted status will not be included in the results.

Example Syntax

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

import { GlueClient, GetSchemaVersionCommand } from "@aws-sdk/client-glue"; // ES Modules import
// const { GlueClient, GetSchemaVersionCommand } = require("@aws-sdk/client-glue"); // CommonJS import
const client = new GlueClient(config);
const input = { // GetSchemaVersionInput
  SchemaId: { // SchemaId
    SchemaArn: "STRING_VALUE",
    SchemaName: "STRING_VALUE",
    RegistryName: "STRING_VALUE",
  },
  SchemaVersionId: "STRING_VALUE",
  SchemaVersionNumber: { // SchemaVersionNumber
    LatestVersion: true || false,
    VersionNumber: Number("long"),
  },
};
const command = new GetSchemaVersionCommand(input);
const response = await client.send(command);
// { // GetSchemaVersionResponse
//   SchemaVersionId: "STRING_VALUE",
//   SchemaDefinition: "STRING_VALUE",
//   DataFormat: "AVRO" || "JSON" || "PROTOBUF",
//   SchemaArn: "STRING_VALUE",
//   VersionNumber: Number("long"),
//   Status: "AVAILABLE" || "PENDING" || "FAILURE" || "DELETING",
//   CreatedTime: "STRING_VALUE",
// };

GetSchemaVersionCommand Input

See GetSchemaVersionCommandInput for more details

Parameter
Type
Description
SchemaId
SchemaId | undefined

This is a wrapper structure to contain schema identity fields. The structure contains:

  • SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. Either SchemaArn or SchemaName and RegistryName has to be provided.

  • SchemaId$SchemaName: The name of the schema. Either SchemaArn or SchemaName and RegistryName has to be provided.

SchemaVersionId
string | undefined

The SchemaVersionId of the schema version. This field is required for fetching by schema ID. Either this or the SchemaId wrapper has to be provided.

SchemaVersionNumber
SchemaVersionNumber | undefined

The version number of the schema.

GetSchemaVersionCommand Output

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

The date and time the schema version was created.

DataFormat
DataFormat | undefined

The data format of the schema definition. Currently AVRO, JSON and PROTOBUF are supported.

SchemaArn
string | undefined

The Amazon Resource Name (ARN) of the schema.

SchemaDefinition
string | undefined

The schema definition for the schema ID.

SchemaVersionId
string | undefined

The SchemaVersionId of the schema version.

Status
SchemaVersionStatus | undefined

The status of the schema version.

VersionNumber
number | undefined

The version number of the schema.

Throws

Name
Fault
Details
AccessDeniedException
client

Access to a resource was denied.

EntityNotFoundException
client

A specified entity does not exist

InternalServiceException
server

An internal service error occurred.

InvalidInputException
client

The input provided was not valid.

GlueServiceException
Base exception class for all service exceptions from Glue service.